squad-kit 1.2.2 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (25) hide show
  1. package/README.md +6 -4
  2. package/SECURITY.md +7 -0
  3. package/dist/cli.js +1094 -46398
  4. package/dist/console-ui/assets/index-DqDPMvqu.css +1 -0
  5. package/dist/console-ui/assets/index-iFT5f2Y0.js +669 -0
  6. package/dist/console-ui/index.html +2 -2
  7. package/package.json +1 -2
  8. package/CHANGELOG.md +0 -1204
  9. package/dist/console-ui/assets/index-CzFTrbcF.js +0 -637
  10. package/dist/console-ui/assets/index-kEkCko25.css +0 -1
  11. package/dist/console-ui/assets/jetbrains-mono-cyrillic-400-normal-BEIGL1Tu.woff2 +0 -0
  12. package/dist/console-ui/assets/jetbrains-mono-cyrillic-500-normal-DmUKJPL_.woff2 +0 -0
  13. package/dist/console-ui/assets/jetbrains-mono-cyrillic-600-normal-EVf6-Yzo.woff2 +0 -0
  14. package/dist/console-ui/assets/jetbrains-mono-cyrillic-ext-400-normal-C_uLvvQ5.woff2 +0 -0
  15. package/dist/console-ui/assets/jetbrains-mono-cyrillic-ext-500-normal-C9ShMxGR.woff2 +0 -0
  16. package/dist/console-ui/assets/jetbrains-mono-cyrillic-ext-600-normal-Dj6eZy5f.woff2 +0 -0
  17. package/dist/console-ui/assets/jetbrains-mono-greek-400-normal-C190GLew.woff2 +0 -0
  18. package/dist/console-ui/assets/jetbrains-mono-greek-500-normal-JpySY46c.woff2 +0 -0
  19. package/dist/console-ui/assets/jetbrains-mono-greek-600-normal-H7WoG9Et.woff2 +0 -0
  20. package/dist/console-ui/assets/jetbrains-mono-latin-ext-400-normal-Bc8Ftmh3.woff2 +0 -0
  21. package/dist/console-ui/assets/jetbrains-mono-latin-ext-500-normal-Cut-4mMH.woff2 +0 -0
  22. package/dist/console-ui/assets/jetbrains-mono-latin-ext-600-normal-BfB_LPfz.woff2 +0 -0
  23. package/dist/console-ui/assets/jetbrains-mono-vietnamese-400-normal-ByoDsISC.woff2 +0 -0
  24. package/dist/console-ui/assets/jetbrains-mono-vietnamese-500-normal-BvH7FW2L.woff2 +0 -0
  25. package/dist/console-ui/assets/jetbrains-mono-vietnamese-600-normal-Dtizs43-.woff2 +0 -0
@@ -1,637 +0,0 @@
1
- (function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))r(a);new MutationObserver(a=>{for(const o of a)if(o.type==="childList")for(const c of o.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&r(c)}).observe(document,{childList:!0,subtree:!0});function s(a){const o={};return a.integrity&&(o.integrity=a.integrity),a.referrerPolicy&&(o.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?o.credentials="include":a.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(a){if(a.ep)return;a.ep=!0;const o=s(a);fetch(a.href,o)}})();function hf(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var fh={exports:{}},Ma={},mh={exports:{}},_e={};/**
2
- * @license React
3
- * react.production.min.js
4
- *
5
- * Copyright (c) Facebook, Inc. and its affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */var kg;function q3(){if(kg)return _e;kg=1;var e=Symbol.for("react.element"),n=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),c=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),m=Symbol.iterator;function y(D){return D===null||typeof D!="object"?null:(D=m&&D[m]||D["@@iterator"],typeof D=="function"?D:null)}var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},k=Object.assign,v={};function b(D,ee,z){this.props=D,this.context=ee,this.refs=v,this.updater=z||x}b.prototype.isReactComponent={},b.prototype.setState=function(D,ee){if(typeof D!="object"&&typeof D!="function"&&D!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,D,ee,"setState")},b.prototype.forceUpdate=function(D){this.updater.enqueueForceUpdate(this,D,"forceUpdate")};function N(){}N.prototype=b.prototype;function C(D,ee,z){this.props=D,this.context=ee,this.refs=v,this.updater=z||x}var S=C.prototype=new N;S.constructor=C,k(S,b.prototype),S.isPureReactComponent=!0;var P=Array.isArray,M=Object.prototype.hasOwnProperty,T={current:null},F={key:!0,ref:!0,__self:!0,__source:!0};function R(D,ee,z){var me,he={},ke=null,Re=null;if(ee!=null)for(me in ee.ref!==void 0&&(Re=ee.ref),ee.key!==void 0&&(ke=""+ee.key),ee)M.call(ee,me)&&!F.hasOwnProperty(me)&&(he[me]=ee[me]);var Ae=arguments.length-2;if(Ae===1)he.children=z;else if(1<Ae){for(var $e=Array(Ae),De=0;De<Ae;De++)$e[De]=arguments[De+2];he.children=$e}if(D&&D.defaultProps)for(me in Ae=D.defaultProps,Ae)he[me]===void 0&&(he[me]=Ae[me]);return{$$typeof:e,type:D,key:ke,ref:Re,props:he,_owner:T.current}}function B(D,ee){return{$$typeof:e,type:D.type,key:ee,ref:D.ref,props:D.props,_owner:D._owner}}function I(D){return typeof D=="object"&&D!==null&&D.$$typeof===e}function O(D){var ee={"=":"=0",":":"=2"};return"$"+D.replace(/[=:]/g,function(z){return ee[z]})}var _=/\/+/g;function Q(D,ee){return typeof D=="object"&&D!==null&&D.key!=null?O(""+D.key):ee.toString(36)}function q(D,ee,z,me,he){var ke=typeof D;(ke==="undefined"||ke==="boolean")&&(D=null);var Re=!1;if(D===null)Re=!0;else switch(ke){case"string":case"number":Re=!0;break;case"object":switch(D.$$typeof){case e:case n:Re=!0}}if(Re)return Re=D,he=he(Re),D=me===""?"."+Q(Re,0):me,P(he)?(z="",D!=null&&(z=D.replace(_,"$&/")+"/"),q(he,ee,z,"",function(De){return De})):he!=null&&(I(he)&&(he=B(he,z+(!he.key||Re&&Re.key===he.key?"":(""+he.key).replace(_,"$&/")+"/")+D)),ee.push(he)),1;if(Re=0,me=me===""?".":me+":",P(D))for(var Ae=0;Ae<D.length;Ae++){ke=D[Ae];var $e=me+Q(ke,Ae);Re+=q(ke,ee,z,$e,he)}else if($e=y(D),typeof $e=="function")for(D=$e.call(D),Ae=0;!(ke=D.next()).done;)ke=ke.value,$e=me+Q(ke,Ae++),Re+=q(ke,ee,z,$e,he);else if(ke==="object")throw ee=String(D),Error("Objects are not valid as a React child (found: "+(ee==="[object Object]"?"object with keys {"+Object.keys(D).join(", ")+"}":ee)+"). If you meant to render a collection of children, use an array instead.");return Re}function K(D,ee,z){if(D==null)return D;var me=[],he=0;return q(D,me,"","",function(ke){return ee.call(z,ke,he++)}),me}function ce(D){if(D._status===-1){var ee=D._result;ee=ee(),ee.then(function(z){(D._status===0||D._status===-1)&&(D._status=1,D._result=z)},function(z){(D._status===0||D._status===-1)&&(D._status=2,D._result=z)}),D._status===-1&&(D._status=0,D._result=ee)}if(D._status===1)return D._result.default;throw D._result}var H={current:null},V={transition:null},ne={ReactCurrentDispatcher:H,ReactCurrentBatchConfig:V,ReactCurrentOwner:T};function A(){throw Error("act(...) is not supported in production builds of React.")}return _e.Children={map:K,forEach:function(D,ee,z){K(D,function(){ee.apply(this,arguments)},z)},count:function(D){var ee=0;return K(D,function(){ee++}),ee},toArray:function(D){return K(D,function(ee){return ee})||[]},only:function(D){if(!I(D))throw Error("React.Children.only expected to receive a single React element child.");return D}},_e.Component=b,_e.Fragment=s,_e.Profiler=a,_e.PureComponent=C,_e.StrictMode=r,_e.Suspense=d,_e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ne,_e.act=A,_e.cloneElement=function(D,ee,z){if(D==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+D+".");var me=k({},D.props),he=D.key,ke=D.ref,Re=D._owner;if(ee!=null){if(ee.ref!==void 0&&(ke=ee.ref,Re=T.current),ee.key!==void 0&&(he=""+ee.key),D.type&&D.type.defaultProps)var Ae=D.type.defaultProps;for($e in ee)M.call(ee,$e)&&!F.hasOwnProperty($e)&&(me[$e]=ee[$e]===void 0&&Ae!==void 0?Ae[$e]:ee[$e])}var $e=arguments.length-2;if($e===1)me.children=z;else if(1<$e){Ae=Array($e);for(var De=0;De<$e;De++)Ae[De]=arguments[De+2];me.children=Ae}return{$$typeof:e,type:D.type,key:he,ref:ke,props:me,_owner:Re}},_e.createContext=function(D){return D={$$typeof:c,_currentValue:D,_currentValue2:D,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},D.Provider={$$typeof:o,_context:D},D.Consumer=D},_e.createElement=R,_e.createFactory=function(D){var ee=R.bind(null,D);return ee.type=D,ee},_e.createRef=function(){return{current:null}},_e.forwardRef=function(D){return{$$typeof:u,render:D}},_e.isValidElement=I,_e.lazy=function(D){return{$$typeof:f,_payload:{_status:-1,_result:D},_init:ce}},_e.memo=function(D,ee){return{$$typeof:p,type:D,compare:ee===void 0?null:ee}},_e.startTransition=function(D){var ee=V.transition;V.transition={};try{D()}finally{V.transition=ee}},_e.unstable_act=A,_e.useCallback=function(D,ee){return H.current.useCallback(D,ee)},_e.useContext=function(D){return H.current.useContext(D)},_e.useDebugValue=function(){},_e.useDeferredValue=function(D){return H.current.useDeferredValue(D)},_e.useEffect=function(D,ee){return H.current.useEffect(D,ee)},_e.useId=function(){return H.current.useId()},_e.useImperativeHandle=function(D,ee,z){return H.current.useImperativeHandle(D,ee,z)},_e.useInsertionEffect=function(D,ee){return H.current.useInsertionEffect(D,ee)},_e.useLayoutEffect=function(D,ee){return H.current.useLayoutEffect(D,ee)},_e.useMemo=function(D,ee){return H.current.useMemo(D,ee)},_e.useReducer=function(D,ee,z){return H.current.useReducer(D,ee,z)},_e.useRef=function(D){return H.current.useRef(D)},_e.useState=function(D){return H.current.useState(D)},_e.useSyncExternalStore=function(D,ee,z){return H.current.useSyncExternalStore(D,ee,z)},_e.useTransition=function(){return H.current.useTransition()},_e.version="18.3.1",_e}var vg;function So(){return vg||(vg=1,mh.exports=q3()),mh.exports}/**
10
- * @license React
11
- * react-jsx-runtime.production.min.js
12
- *
13
- * Copyright (c) Facebook, Inc. and its affiliates.
14
- *
15
- * This source code is licensed under the MIT license found in the
16
- * LICENSE file in the root directory of this source tree.
17
- */var jg;function D3(){if(jg)return Ma;jg=1;var e=So(),n=Symbol.for("react.element"),s=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,a=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function c(u,d,p){var f,m={},y=null,x=null;p!==void 0&&(y=""+p),d.key!==void 0&&(y=""+d.key),d.ref!==void 0&&(x=d.ref);for(f in d)r.call(d,f)&&!o.hasOwnProperty(f)&&(m[f]=d[f]);if(u&&u.defaultProps)for(f in d=u.defaultProps,d)m[f]===void 0&&(m[f]=d[f]);return{$$typeof:n,type:u,key:y,ref:x,props:m,_owner:a.current}}return Ma.Fragment=s,Ma.jsx=c,Ma.jsxs=c,Ma}var bg;function B3(){return bg||(bg=1,fh.exports=D3()),fh.exports}var t=B3(),$=So();const Ja=hf($);var Xl={},gh={exports:{}},Xt={},xh={exports:{}},yh={};/**
18
- * @license React
19
- * scheduler.production.min.js
20
- *
21
- * Copyright (c) Facebook, Inc. and its affiliates.
22
- *
23
- * This source code is licensed under the MIT license found in the
24
- * LICENSE file in the root directory of this source tree.
25
- */var wg;function W3(){return wg||(wg=1,(function(e){function n(V,ne){var A=V.length;V.push(ne);e:for(;0<A;){var D=A-1>>>1,ee=V[D];if(0<a(ee,ne))V[D]=ne,V[A]=ee,A=D;else break e}}function s(V){return V.length===0?null:V[0]}function r(V){if(V.length===0)return null;var ne=V[0],A=V.pop();if(A!==ne){V[0]=A;e:for(var D=0,ee=V.length,z=ee>>>1;D<z;){var me=2*(D+1)-1,he=V[me],ke=me+1,Re=V[ke];if(0>a(he,A))ke<ee&&0>a(Re,he)?(V[D]=Re,V[ke]=A,D=ke):(V[D]=he,V[me]=A,D=me);else if(ke<ee&&0>a(Re,A))V[D]=Re,V[ke]=A,D=ke;else break e}}return ne}function a(V,ne){var A=V.sortIndex-ne.sortIndex;return A!==0?A:V.id-ne.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var c=Date,u=c.now();e.unstable_now=function(){return c.now()-u}}var d=[],p=[],f=1,m=null,y=3,x=!1,k=!1,v=!1,b=typeof setTimeout=="function"?setTimeout:null,N=typeof clearTimeout=="function"?clearTimeout:null,C=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function S(V){for(var ne=s(p);ne!==null;){if(ne.callback===null)r(p);else if(ne.startTime<=V)r(p),ne.sortIndex=ne.expirationTime,n(d,ne);else break;ne=s(p)}}function P(V){if(v=!1,S(V),!k)if(s(d)!==null)k=!0,ce(M);else{var ne=s(p);ne!==null&&H(P,ne.startTime-V)}}function M(V,ne){k=!1,v&&(v=!1,N(R),R=-1),x=!0;var A=y;try{for(S(ne),m=s(d);m!==null&&(!(m.expirationTime>ne)||V&&!O());){var D=m.callback;if(typeof D=="function"){m.callback=null,y=m.priorityLevel;var ee=D(m.expirationTime<=ne);ne=e.unstable_now(),typeof ee=="function"?m.callback=ee:m===s(d)&&r(d),S(ne)}else r(d);m=s(d)}if(m!==null)var z=!0;else{var me=s(p);me!==null&&H(P,me.startTime-ne),z=!1}return z}finally{m=null,y=A,x=!1}}var T=!1,F=null,R=-1,B=5,I=-1;function O(){return!(e.unstable_now()-I<B)}function _(){if(F!==null){var V=e.unstable_now();I=V;var ne=!0;try{ne=F(!0,V)}finally{ne?Q():(T=!1,F=null)}}else T=!1}var Q;if(typeof C=="function")Q=function(){C(_)};else if(typeof MessageChannel<"u"){var q=new MessageChannel,K=q.port2;q.port1.onmessage=_,Q=function(){K.postMessage(null)}}else Q=function(){b(_,0)};function ce(V){F=V,T||(T=!0,Q())}function H(V,ne){R=b(function(){V(e.unstable_now())},ne)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(V){V.callback=null},e.unstable_continueExecution=function(){k||x||(k=!0,ce(M))},e.unstable_forceFrameRate=function(V){0>V||125<V?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):B=0<V?Math.floor(1e3/V):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_getFirstCallbackNode=function(){return s(d)},e.unstable_next=function(V){switch(y){case 1:case 2:case 3:var ne=3;break;default:ne=y}var A=y;y=ne;try{return V()}finally{y=A}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(V,ne){switch(V){case 1:case 2:case 3:case 4:case 5:break;default:V=3}var A=y;y=V;try{return ne()}finally{y=A}},e.unstable_scheduleCallback=function(V,ne,A){var D=e.unstable_now();switch(typeof A=="object"&&A!==null?(A=A.delay,A=typeof A=="number"&&0<A?D+A:D):A=D,V){case 1:var ee=-1;break;case 2:ee=250;break;case 5:ee=1073741823;break;case 4:ee=1e4;break;default:ee=5e3}return ee=A+ee,V={id:f++,callback:ne,priorityLevel:V,startTime:A,expirationTime:ee,sortIndex:-1},A>D?(V.sortIndex=A,n(p,V),s(d)===null&&V===s(p)&&(v?(N(R),R=-1):v=!0,H(P,A-D))):(V.sortIndex=ee,n(d,V),k||x||(k=!0,ce(M))),V},e.unstable_shouldYield=O,e.unstable_wrapCallback=function(V){var ne=y;return function(){var A=y;y=ne;try{return V.apply(this,arguments)}finally{y=A}}}})(yh)),yh}var Ng;function U3(){return Ng||(Ng=1,xh.exports=W3()),xh.exports}/**
26
- * @license React
27
- * react-dom.production.min.js
28
- *
29
- * Copyright (c) Facebook, Inc. and its affiliates.
30
- *
31
- * This source code is licensed under the MIT license found in the
32
- * LICENSE file in the root directory of this source tree.
33
- */var Sg;function H3(){if(Sg)return Xt;Sg=1;var e=So(),n=U3();function s(i){for(var l="https://reactjs.org/docs/error-decoder.html?invariant="+i,h=1;h<arguments.length;h++)l+="&args[]="+encodeURIComponent(arguments[h]);return"Minified React error #"+i+"; visit "+l+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var r=new Set,a={};function o(i,l){c(i,l),c(i+"Capture",l)}function c(i,l){for(a[i]=l,i=0;i<l.length;i++)r.add(l[i])}var u=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),d=Object.prototype.hasOwnProperty,p=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,f={},m={};function y(i){return d.call(m,i)?!0:d.call(f,i)?!1:p.test(i)?m[i]=!0:(f[i]=!0,!1)}function x(i,l,h,g){if(h!==null&&h.type===0)return!1;switch(typeof l){case"function":case"symbol":return!0;case"boolean":return g?!1:h!==null?!h.acceptsBooleans:(i=i.toLowerCase().slice(0,5),i!=="data-"&&i!=="aria-");default:return!1}}function k(i,l,h,g){if(l===null||typeof l>"u"||x(i,l,h,g))return!0;if(g)return!1;if(h!==null)switch(h.type){case 3:return!l;case 4:return l===!1;case 5:return isNaN(l);case 6:return isNaN(l)||1>l}return!1}function v(i,l,h,g,j,w,E){this.acceptsBooleans=l===2||l===3||l===4,this.attributeName=g,this.attributeNamespace=j,this.mustUseProperty=h,this.propertyName=i,this.type=l,this.sanitizeURL=w,this.removeEmptyString=E}var b={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(i){b[i]=new v(i,0,!1,i,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(i){var l=i[0];b[l]=new v(l,1,!1,i[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(i){b[i]=new v(i,2,!1,i.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(i){b[i]=new v(i,2,!1,i,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(i){b[i]=new v(i,3,!1,i.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(i){b[i]=new v(i,3,!0,i,null,!1,!1)}),["capture","download"].forEach(function(i){b[i]=new v(i,4,!1,i,null,!1,!1)}),["cols","rows","size","span"].forEach(function(i){b[i]=new v(i,6,!1,i,null,!1,!1)}),["rowSpan","start"].forEach(function(i){b[i]=new v(i,5,!1,i.toLowerCase(),null,!1,!1)});var N=/[\-:]([a-z])/g;function C(i){return i[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(i){var l=i.replace(N,C);b[l]=new v(l,1,!1,i,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(i){var l=i.replace(N,C);b[l]=new v(l,1,!1,i,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(i){var l=i.replace(N,C);b[l]=new v(l,1,!1,i,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(i){b[i]=new v(i,1,!1,i.toLowerCase(),null,!1,!1)}),b.xlinkHref=new v("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(i){b[i]=new v(i,1,!1,i.toLowerCase(),null,!0,!0)});function S(i,l,h,g){var j=b.hasOwnProperty(l)?b[l]:null;(j!==null?j.type!==0:g||!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(k(l,h,j,g)&&(h=null),g||j===null?y(l)&&(h===null?i.removeAttribute(l):i.setAttribute(l,""+h)):j.mustUseProperty?i[j.propertyName]=h===null?j.type===3?!1:"":h:(l=j.attributeName,g=j.attributeNamespace,h===null?i.removeAttribute(l):(j=j.type,h=j===3||j===4&&h===!0?"":""+h,g?i.setAttributeNS(g,l,h):i.setAttribute(l,h))))}var P=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,M=Symbol.for("react.element"),T=Symbol.for("react.portal"),F=Symbol.for("react.fragment"),R=Symbol.for("react.strict_mode"),B=Symbol.for("react.profiler"),I=Symbol.for("react.provider"),O=Symbol.for("react.context"),_=Symbol.for("react.forward_ref"),Q=Symbol.for("react.suspense"),q=Symbol.for("react.suspense_list"),K=Symbol.for("react.memo"),ce=Symbol.for("react.lazy"),H=Symbol.for("react.offscreen"),V=Symbol.iterator;function ne(i){return i===null||typeof i!="object"?null:(i=V&&i[V]||i["@@iterator"],typeof i=="function"?i:null)}var A=Object.assign,D;function ee(i){if(D===void 0)try{throw Error()}catch(h){var l=h.stack.trim().match(/\n( *(at )?)/);D=l&&l[1]||""}return`
34
- `+D+i}var z=!1;function me(i,l){if(!i||z)return"";z=!0;var h=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(l)if(l=function(){throw Error()},Object.defineProperty(l.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(l,[])}catch(Z){var g=Z}Reflect.construct(i,[],l)}else{try{l.call()}catch(Z){g=Z}i.call(l.prototype)}else{try{throw Error()}catch(Z){g=Z}i()}}catch(Z){if(Z&&g&&typeof Z.stack=="string"){for(var j=Z.stack.split(`
35
- `),w=g.stack.split(`
36
- `),E=j.length-1,L=w.length-1;1<=E&&0<=L&&j[E]!==w[L];)L--;for(;1<=E&&0<=L;E--,L--)if(j[E]!==w[L]){if(E!==1||L!==1)do if(E--,L--,0>L||j[E]!==w[L]){var W=`
37
- `+j[E].replace(" at new "," at ");return i.displayName&&W.includes("<anonymous>")&&(W=W.replace("<anonymous>",i.displayName)),W}while(1<=E&&0<=L);break}}}finally{z=!1,Error.prepareStackTrace=h}return(i=i?i.displayName||i.name:"")?ee(i):""}function he(i){switch(i.tag){case 5:return ee(i.type);case 16:return ee("Lazy");case 13:return ee("Suspense");case 19:return ee("SuspenseList");case 0:case 2:case 15:return i=me(i.type,!1),i;case 11:return i=me(i.type.render,!1),i;case 1:return i=me(i.type,!0),i;default:return""}}function ke(i){if(i==null)return null;if(typeof i=="function")return i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case F:return"Fragment";case T:return"Portal";case B:return"Profiler";case R:return"StrictMode";case Q:return"Suspense";case q:return"SuspenseList"}if(typeof i=="object")switch(i.$$typeof){case O:return(i.displayName||"Context")+".Consumer";case I:return(i._context.displayName||"Context")+".Provider";case _:var l=i.render;return i=i.displayName,i||(i=l.displayName||l.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case K:return l=i.displayName||null,l!==null?l:ke(i.type)||"Memo";case ce:l=i._payload,i=i._init;try{return ke(i(l))}catch{}}return null}function Re(i){var l=i.type;switch(i.tag){case 24:return"Cache";case 9:return(l.displayName||"Context")+".Consumer";case 10:return(l._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return i=l.render,i=i.displayName||i.name||"",l.displayName||(i!==""?"ForwardRef("+i+")":"ForwardRef");case 7:return"Fragment";case 5:return l;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ke(l);case 8:return l===R?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof l=="function")return l.displayName||l.name||null;if(typeof l=="string")return l}return null}function Ae(i){switch(typeof i){case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function $e(i){var l=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function De(i){var l=$e(i)?"checked":"value",h=Object.getOwnPropertyDescriptor(i.constructor.prototype,l),g=""+i[l];if(!i.hasOwnProperty(l)&&typeof h<"u"&&typeof h.get=="function"&&typeof h.set=="function"){var j=h.get,w=h.set;return Object.defineProperty(i,l,{configurable:!0,get:function(){return j.call(this)},set:function(E){g=""+E,w.call(this,E)}}),Object.defineProperty(i,l,{enumerable:h.enumerable}),{getValue:function(){return g},setValue:function(E){g=""+E},stopTracking:function(){i._valueTracker=null,delete i[l]}}}}function ct(i){i._valueTracker||(i._valueTracker=De(i))}function Ut(i){if(!i)return!1;var l=i._valueTracker;if(!l)return!0;var h=l.getValue(),g="";return i&&(g=$e(i)?i.checked?"true":"false":i.value),i=g,i!==h?(l.setValue(i),!0):!1}function on(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}function Kn(i,l){var h=l.checked;return A({},l,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:h??i._wrapperState.initialChecked})}function Ht(i,l){var h=l.defaultValue==null?"":l.defaultValue,g=l.checked!=null?l.checked:l.defaultChecked;h=Ae(l.value!=null?l.value:h),i._wrapperState={initialChecked:g,initialValue:h,controlled:l.type==="checkbox"||l.type==="radio"?l.checked!=null:l.value!=null}}function Mn(i,l){l=l.checked,l!=null&&S(i,"checked",l,!1)}function bn(i,l){Mn(i,l);var h=Ae(l.value),g=l.type;if(h!=null)g==="number"?(h===0&&i.value===""||i.value!=h)&&(i.value=""+h):i.value!==""+h&&(i.value=""+h);else if(g==="submit"||g==="reset"){i.removeAttribute("value");return}l.hasOwnProperty("value")?Vt(i,l.type,h):l.hasOwnProperty("defaultValue")&&Vt(i,l.type,Ae(l.defaultValue)),l.checked==null&&l.defaultChecked!=null&&(i.defaultChecked=!!l.defaultChecked)}function ln(i,l,h){if(l.hasOwnProperty("value")||l.hasOwnProperty("defaultValue")){var g=l.type;if(!(g!=="submit"&&g!=="reset"||l.value!==void 0&&l.value!==null))return;l=""+i._wrapperState.initialValue,h||l===i.value||(i.value=l),i.defaultValue=l}h=i.name,h!==""&&(i.name=""),i.defaultChecked=!!i._wrapperState.initialChecked,h!==""&&(i.name=h)}function Vt(i,l,h){(l!=="number"||on(i.ownerDocument)!==i)&&(h==null?i.defaultValue=""+i._wrapperState.initialValue:i.defaultValue!==""+h&&(i.defaultValue=""+h))}var xt=Array.isArray;function cn(i,l,h,g){if(i=i.options,l){l={};for(var j=0;j<h.length;j++)l["$"+h[j]]=!0;for(h=0;h<i.length;h++)j=l.hasOwnProperty("$"+i[h].value),i[h].selected!==j&&(i[h].selected=j),j&&g&&(i[h].defaultSelected=!0)}else{for(h=""+Ae(h),l=null,j=0;j<i.length;j++){if(i[j].value===h){i[j].selected=!0,g&&(i[j].defaultSelected=!0);return}l!==null||i[j].disabled||(l=i[j])}l!==null&&(l.selected=!0)}}function Yn(i,l){if(l.dangerouslySetInnerHTML!=null)throw Error(s(91));return A({},l,{value:void 0,defaultValue:void 0,children:""+i._wrapperState.initialValue})}function Ms(i,l){var h=l.value;if(h==null){if(h=l.children,l=l.defaultValue,h!=null){if(l!=null)throw Error(s(92));if(xt(h)){if(1<h.length)throw Error(s(93));h=h[0]}l=h}l==null&&(l=""),h=l}i._wrapperState={initialValue:Ae(h)}}function Qn(i,l){var h=Ae(l.value),g=Ae(l.defaultValue);h!=null&&(h=""+h,h!==i.value&&(i.value=h),l.defaultValue==null&&i.defaultValue!==h&&(i.defaultValue=h)),g!=null&&(i.defaultValue=""+g)}function He(i){var l=i.textContent;l===i._wrapperState.initialValue&&l!==""&&l!==null&&(i.value=l)}function X(i){switch(i){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function le(i,l){return i==null||i==="http://www.w3.org/1999/xhtml"?X(l):i==="http://www.w3.org/2000/svg"&&l==="foreignObject"?"http://www.w3.org/1999/xhtml":i}var be,Me=(function(i){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(l,h,g,j){MSApp.execUnsafeLocalFunction(function(){return i(l,h,g,j)})}:i})(function(i,l){if(i.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in i)i.innerHTML=l;else{for(be=be||document.createElement("div"),be.innerHTML="<svg>"+l.valueOf().toString()+"</svg>",l=be.firstChild;i.firstChild;)i.removeChild(i.firstChild);for(;l.firstChild;)i.appendChild(l.firstChild)}});function J(i,l){if(l){var h=i.firstChild;if(h&&h===i.lastChild&&h.nodeType===3){h.nodeValue=l;return}}i.textContent=l}var Fe={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Nt=["Webkit","ms","Moz","O"];Object.keys(Fe).forEach(function(i){Nt.forEach(function(l){l=l+i.charAt(0).toUpperCase()+i.substring(1),Fe[l]=Fe[i]})});function st(i,l,h){return l==null||typeof l=="boolean"||l===""?"":h||typeof l!="number"||l===0||Fe.hasOwnProperty(i)&&Fe[i]?(""+l).trim():l+"px"}function yt(i,l){i=i.style;for(var h in l)if(l.hasOwnProperty(h)){var g=h.indexOf("--")===0,j=st(h,l[h],g);h==="float"&&(h="cssFloat"),g?i.setProperty(h,j):i[h]=j}}var pr=A({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function St(i,l){if(l){if(pr[i]&&(l.children!=null||l.dangerouslySetInnerHTML!=null))throw Error(s(137,i));if(l.dangerouslySetInnerHTML!=null){if(l.children!=null)throw Error(s(60));if(typeof l.dangerouslySetInnerHTML!="object"||!("__html"in l.dangerouslySetInnerHTML))throw Error(s(61))}if(l.style!=null&&typeof l.style!="object")throw Error(s(62))}}function Gn(i,l){if(i.indexOf("-")===-1)return typeof l.is=="string";switch(i){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var un=null;function Tu(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var Au=null,Xr=null,Jr=null;function Fm(i){if(i=va(i)){if(typeof Au!="function")throw Error(s(280));var l=i.stateNode;l&&(l=pl(l),Au(i.stateNode,i.type,l))}}function Lm(i){Xr?Jr?Jr.push(i):Jr=[i]:Xr=i}function _m(){if(Xr){var i=Xr,l=Jr;if(Jr=Xr=null,Fm(i),l)for(i=0;i<l.length;i++)Fm(l[i])}}function Om(i,l){return i(l)}function qm(){}var Pu=!1;function Dm(i,l,h){if(Pu)return i(l,h);Pu=!0;try{return Om(i,l,h)}finally{Pu=!1,(Xr!==null||Jr!==null)&&(qm(),_m())}}function Ji(i,l){var h=i.stateNode;if(h===null)return null;var g=pl(h);if(g===null)return null;h=g[l];e:switch(l){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(g=!g.disabled)||(i=i.type,g=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!g;break e;default:i=!1}if(i)return null;if(h&&typeof h!="function")throw Error(s(231,l,typeof h));return h}var Ru=!1;if(u)try{var ea={};Object.defineProperty(ea,"passive",{get:function(){Ru=!0}}),window.addEventListener("test",ea,ea),window.removeEventListener("test",ea,ea)}catch{Ru=!1}function Vb(i,l,h,g,j,w,E,L,W){var Z=Array.prototype.slice.call(arguments,3);try{l.apply(h,Z)}catch(ie){this.onError(ie)}}var ta=!1,Ho=null,Vo=!1,Iu=null,Kb={onError:function(i){ta=!0,Ho=i}};function Yb(i,l,h,g,j,w,E,L,W){ta=!1,Ho=null,Vb.apply(Kb,arguments)}function Qb(i,l,h,g,j,w,E,L,W){if(Yb.apply(this,arguments),ta){if(ta){var Z=Ho;ta=!1,Ho=null}else throw Error(s(198));Vo||(Vo=!0,Iu=Z)}}function fr(i){var l=i,h=i;if(i.alternate)for(;l.return;)l=l.return;else{i=l;do l=i,(l.flags&4098)!==0&&(h=l.return),i=l.return;while(i)}return l.tag===3?h:null}function Bm(i){if(i.tag===13){var l=i.memoizedState;if(l===null&&(i=i.alternate,i!==null&&(l=i.memoizedState)),l!==null)return l.dehydrated}return null}function Wm(i){if(fr(i)!==i)throw Error(s(188))}function Gb(i){var l=i.alternate;if(!l){if(l=fr(i),l===null)throw Error(s(188));return l!==i?null:i}for(var h=i,g=l;;){var j=h.return;if(j===null)break;var w=j.alternate;if(w===null){if(g=j.return,g!==null){h=g;continue}break}if(j.child===w.child){for(w=j.child;w;){if(w===h)return Wm(j),i;if(w===g)return Wm(j),l;w=w.sibling}throw Error(s(188))}if(h.return!==g.return)h=j,g=w;else{for(var E=!1,L=j.child;L;){if(L===h){E=!0,h=j,g=w;break}if(L===g){E=!0,g=j,h=w;break}L=L.sibling}if(!E){for(L=w.child;L;){if(L===h){E=!0,h=w,g=j;break}if(L===g){E=!0,g=w,h=j;break}L=L.sibling}if(!E)throw Error(s(189))}}if(h.alternate!==g)throw Error(s(190))}if(h.tag!==3)throw Error(s(188));return h.stateNode.current===h?i:l}function Um(i){return i=Gb(i),i!==null?Hm(i):null}function Hm(i){if(i.tag===5||i.tag===6)return i;for(i=i.child;i!==null;){var l=Hm(i);if(l!==null)return l;i=i.sibling}return null}var Vm=n.unstable_scheduleCallback,Km=n.unstable_cancelCallback,Zb=n.unstable_shouldYield,Xb=n.unstable_requestPaint,ut=n.unstable_now,Jb=n.unstable_getCurrentPriorityLevel,zu=n.unstable_ImmediatePriority,Ym=n.unstable_UserBlockingPriority,Ko=n.unstable_NormalPriority,ew=n.unstable_LowPriority,Qm=n.unstable_IdlePriority,Yo=null,Zn=null;function tw(i){if(Zn&&typeof Zn.onCommitFiberRoot=="function")try{Zn.onCommitFiberRoot(Yo,i,void 0,(i.current.flags&128)===128)}catch{}}var Fn=Math.clz32?Math.clz32:rw,nw=Math.log,sw=Math.LN2;function rw(i){return i>>>=0,i===0?32:31-(nw(i)/sw|0)|0}var Qo=64,Go=4194304;function na(i){switch(i&-i){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return i&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return i&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return i}}function Zo(i,l){var h=i.pendingLanes;if(h===0)return 0;var g=0,j=i.suspendedLanes,w=i.pingedLanes,E=h&268435455;if(E!==0){var L=E&~j;L!==0?g=na(L):(w&=E,w!==0&&(g=na(w)))}else E=h&~j,E!==0?g=na(E):w!==0&&(g=na(w));if(g===0)return 0;if(l!==0&&l!==g&&(l&j)===0&&(j=g&-g,w=l&-l,j>=w||j===16&&(w&4194240)!==0))return l;if((g&4)!==0&&(g|=h&16),l=i.entangledLanes,l!==0)for(i=i.entanglements,l&=g;0<l;)h=31-Fn(l),j=1<<h,g|=i[h],l&=~j;return g}function iw(i,l){switch(i){case 1:case 2:case 4:return l+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return l+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function aw(i,l){for(var h=i.suspendedLanes,g=i.pingedLanes,j=i.expirationTimes,w=i.pendingLanes;0<w;){var E=31-Fn(w),L=1<<E,W=j[E];W===-1?((L&h)===0||(L&g)!==0)&&(j[E]=iw(L,l)):W<=l&&(i.expiredLanes|=L),w&=~L}}function Mu(i){return i=i.pendingLanes&-1073741825,i!==0?i:i&1073741824?1073741824:0}function Gm(){var i=Qo;return Qo<<=1,(Qo&4194240)===0&&(Qo=64),i}function Fu(i){for(var l=[],h=0;31>h;h++)l.push(i);return l}function sa(i,l,h){i.pendingLanes|=l,l!==536870912&&(i.suspendedLanes=0,i.pingedLanes=0),i=i.eventTimes,l=31-Fn(l),i[l]=h}function ow(i,l){var h=i.pendingLanes&~l;i.pendingLanes=l,i.suspendedLanes=0,i.pingedLanes=0,i.expiredLanes&=l,i.mutableReadLanes&=l,i.entangledLanes&=l,l=i.entanglements;var g=i.eventTimes;for(i=i.expirationTimes;0<h;){var j=31-Fn(h),w=1<<j;l[j]=0,g[j]=-1,i[j]=-1,h&=~w}}function Lu(i,l){var h=i.entangledLanes|=l;for(i=i.entanglements;h;){var g=31-Fn(h),j=1<<g;j&l|i[g]&l&&(i[g]|=l),h&=~j}}var Ke=0;function Zm(i){return i&=-i,1<i?4<i?(i&268435455)!==0?16:536870912:4:1}var Xm,_u,Jm,e1,t1,Ou=!1,Xo=[],Fs=null,Ls=null,_s=null,ra=new Map,ia=new Map,Os=[],lw="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function n1(i,l){switch(i){case"focusin":case"focusout":Fs=null;break;case"dragenter":case"dragleave":Ls=null;break;case"mouseover":case"mouseout":_s=null;break;case"pointerover":case"pointerout":ra.delete(l.pointerId);break;case"gotpointercapture":case"lostpointercapture":ia.delete(l.pointerId)}}function aa(i,l,h,g,j,w){return i===null||i.nativeEvent!==w?(i={blockedOn:l,domEventName:h,eventSystemFlags:g,nativeEvent:w,targetContainers:[j]},l!==null&&(l=va(l),l!==null&&_u(l)),i):(i.eventSystemFlags|=g,l=i.targetContainers,j!==null&&l.indexOf(j)===-1&&l.push(j),i)}function cw(i,l,h,g,j){switch(l){case"focusin":return Fs=aa(Fs,i,l,h,g,j),!0;case"dragenter":return Ls=aa(Ls,i,l,h,g,j),!0;case"mouseover":return _s=aa(_s,i,l,h,g,j),!0;case"pointerover":var w=j.pointerId;return ra.set(w,aa(ra.get(w)||null,i,l,h,g,j)),!0;case"gotpointercapture":return w=j.pointerId,ia.set(w,aa(ia.get(w)||null,i,l,h,g,j)),!0}return!1}function s1(i){var l=mr(i.target);if(l!==null){var h=fr(l);if(h!==null){if(l=h.tag,l===13){if(l=Bm(h),l!==null){i.blockedOn=l,t1(i.priority,function(){Jm(h)});return}}else if(l===3&&h.stateNode.current.memoizedState.isDehydrated){i.blockedOn=h.tag===3?h.stateNode.containerInfo:null;return}}}i.blockedOn=null}function Jo(i){if(i.blockedOn!==null)return!1;for(var l=i.targetContainers;0<l.length;){var h=Du(i.domEventName,i.eventSystemFlags,l[0],i.nativeEvent);if(h===null){h=i.nativeEvent;var g=new h.constructor(h.type,h);un=g,h.target.dispatchEvent(g),un=null}else return l=va(h),l!==null&&_u(l),i.blockedOn=h,!1;l.shift()}return!0}function r1(i,l,h){Jo(i)&&h.delete(l)}function uw(){Ou=!1,Fs!==null&&Jo(Fs)&&(Fs=null),Ls!==null&&Jo(Ls)&&(Ls=null),_s!==null&&Jo(_s)&&(_s=null),ra.forEach(r1),ia.forEach(r1)}function oa(i,l){i.blockedOn===l&&(i.blockedOn=null,Ou||(Ou=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,uw)))}function la(i){function l(j){return oa(j,i)}if(0<Xo.length){oa(Xo[0],i);for(var h=1;h<Xo.length;h++){var g=Xo[h];g.blockedOn===i&&(g.blockedOn=null)}}for(Fs!==null&&oa(Fs,i),Ls!==null&&oa(Ls,i),_s!==null&&oa(_s,i),ra.forEach(l),ia.forEach(l),h=0;h<Os.length;h++)g=Os[h],g.blockedOn===i&&(g.blockedOn=null);for(;0<Os.length&&(h=Os[0],h.blockedOn===null);)s1(h),h.blockedOn===null&&Os.shift()}var ei=P.ReactCurrentBatchConfig,el=!0;function dw(i,l,h,g){var j=Ke,w=ei.transition;ei.transition=null;try{Ke=1,qu(i,l,h,g)}finally{Ke=j,ei.transition=w}}function hw(i,l,h,g){var j=Ke,w=ei.transition;ei.transition=null;try{Ke=4,qu(i,l,h,g)}finally{Ke=j,ei.transition=w}}function qu(i,l,h,g){if(el){var j=Du(i,l,h,g);if(j===null)rd(i,l,g,tl,h),n1(i,g);else if(cw(j,i,l,h,g))g.stopPropagation();else if(n1(i,g),l&4&&-1<lw.indexOf(i)){for(;j!==null;){var w=va(j);if(w!==null&&Xm(w),w=Du(i,l,h,g),w===null&&rd(i,l,g,tl,h),w===j)break;j=w}j!==null&&g.stopPropagation()}else rd(i,l,g,null,h)}}var tl=null;function Du(i,l,h,g){if(tl=null,i=Tu(g),i=mr(i),i!==null)if(l=fr(i),l===null)i=null;else if(h=l.tag,h===13){if(i=Bm(l),i!==null)return i;i=null}else if(h===3){if(l.stateNode.current.memoizedState.isDehydrated)return l.tag===3?l.stateNode.containerInfo:null;i=null}else l!==i&&(i=null);return tl=i,null}function i1(i){switch(i){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Jb()){case zu:return 1;case Ym:return 4;case Ko:case ew:return 16;case Qm:return 536870912;default:return 16}default:return 16}}var qs=null,Bu=null,nl=null;function a1(){if(nl)return nl;var i,l=Bu,h=l.length,g,j="value"in qs?qs.value:qs.textContent,w=j.length;for(i=0;i<h&&l[i]===j[i];i++);var E=h-i;for(g=1;g<=E&&l[h-g]===j[w-g];g++);return nl=j.slice(i,1<g?1-g:void 0)}function sl(i){var l=i.keyCode;return"charCode"in i?(i=i.charCode,i===0&&l===13&&(i=13)):i=l,i===10&&(i=13),32<=i||i===13?i:0}function rl(){return!0}function o1(){return!1}function dn(i){function l(h,g,j,w,E){this._reactName=h,this._targetInst=j,this.type=g,this.nativeEvent=w,this.target=E,this.currentTarget=null;for(var L in i)i.hasOwnProperty(L)&&(h=i[L],this[L]=h?h(w):w[L]);return this.isDefaultPrevented=(w.defaultPrevented!=null?w.defaultPrevented:w.returnValue===!1)?rl:o1,this.isPropagationStopped=o1,this}return A(l.prototype,{preventDefault:function(){this.defaultPrevented=!0;var h=this.nativeEvent;h&&(h.preventDefault?h.preventDefault():typeof h.returnValue!="unknown"&&(h.returnValue=!1),this.isDefaultPrevented=rl)},stopPropagation:function(){var h=this.nativeEvent;h&&(h.stopPropagation?h.stopPropagation():typeof h.cancelBubble!="unknown"&&(h.cancelBubble=!0),this.isPropagationStopped=rl)},persist:function(){},isPersistent:rl}),l}var ti={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Wu=dn(ti),ca=A({},ti,{view:0,detail:0}),pw=dn(ca),Uu,Hu,ua,il=A({},ca,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ku,button:0,buttons:0,relatedTarget:function(i){return i.relatedTarget===void 0?i.fromElement===i.srcElement?i.toElement:i.fromElement:i.relatedTarget},movementX:function(i){return"movementX"in i?i.movementX:(i!==ua&&(ua&&i.type==="mousemove"?(Uu=i.screenX-ua.screenX,Hu=i.screenY-ua.screenY):Hu=Uu=0,ua=i),Uu)},movementY:function(i){return"movementY"in i?i.movementY:Hu}}),l1=dn(il),fw=A({},il,{dataTransfer:0}),mw=dn(fw),gw=A({},ca,{relatedTarget:0}),Vu=dn(gw),xw=A({},ti,{animationName:0,elapsedTime:0,pseudoElement:0}),yw=dn(xw),kw=A({},ti,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),vw=dn(kw),jw=A({},ti,{data:0}),c1=dn(jw),bw={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},ww={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Nw={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Sw(i){var l=this.nativeEvent;return l.getModifierState?l.getModifierState(i):(i=Nw[i])?!!l[i]:!1}function Ku(){return Sw}var Cw=A({},ca,{key:function(i){if(i.key){var l=bw[i.key]||i.key;if(l!=="Unidentified")return l}return i.type==="keypress"?(i=sl(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?ww[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ku,charCode:function(i){return i.type==="keypress"?sl(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?sl(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),$w=dn(Cw),Ew=A({},il,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),u1=dn(Ew),Tw=A({},ca,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ku}),Aw=dn(Tw),Pw=A({},ti,{propertyName:0,elapsedTime:0,pseudoElement:0}),Rw=dn(Pw),Iw=A({},il,{deltaX:function(i){return"deltaX"in i?i.deltaX:"wheelDeltaX"in i?-i.wheelDeltaX:0},deltaY:function(i){return"deltaY"in i?i.deltaY:"wheelDeltaY"in i?-i.wheelDeltaY:"wheelDelta"in i?-i.wheelDelta:0},deltaZ:0,deltaMode:0}),zw=dn(Iw),Mw=[9,13,27,32],Yu=u&&"CompositionEvent"in window,da=null;u&&"documentMode"in document&&(da=document.documentMode);var Fw=u&&"TextEvent"in window&&!da,d1=u&&(!Yu||da&&8<da&&11>=da),h1=" ",p1=!1;function f1(i,l){switch(i){case"keyup":return Mw.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function m1(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var ni=!1;function Lw(i,l){switch(i){case"compositionend":return m1(l);case"keypress":return l.which!==32?null:(p1=!0,h1);case"textInput":return i=l.data,i===h1&&p1?null:i;default:return null}}function _w(i,l){if(ni)return i==="compositionend"||!Yu&&f1(i,l)?(i=a1(),nl=Bu=qs=null,ni=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(l.ctrlKey||l.altKey||l.metaKey)||l.ctrlKey&&l.altKey){if(l.char&&1<l.char.length)return l.char;if(l.which)return String.fromCharCode(l.which)}return null;case"compositionend":return d1&&l.locale!=="ko"?null:l.data;default:return null}}var Ow={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function g1(i){var l=i&&i.nodeName&&i.nodeName.toLowerCase();return l==="input"?!!Ow[i.type]:l==="textarea"}function x1(i,l,h,g){Lm(g),l=ul(l,"onChange"),0<l.length&&(h=new Wu("onChange","change",null,h,g),i.push({event:h,listeners:l}))}var ha=null,pa=null;function qw(i){M1(i,0)}function al(i){var l=oi(i);if(Ut(l))return i}function Dw(i,l){if(i==="change")return l}var y1=!1;if(u){var Qu;if(u){var Gu="oninput"in document;if(!Gu){var k1=document.createElement("div");k1.setAttribute("oninput","return;"),Gu=typeof k1.oninput=="function"}Qu=Gu}else Qu=!1;y1=Qu&&(!document.documentMode||9<document.documentMode)}function v1(){ha&&(ha.detachEvent("onpropertychange",j1),pa=ha=null)}function j1(i){if(i.propertyName==="value"&&al(pa)){var l=[];x1(l,pa,i,Tu(i)),Dm(qw,l)}}function Bw(i,l,h){i==="focusin"?(v1(),ha=l,pa=h,ha.attachEvent("onpropertychange",j1)):i==="focusout"&&v1()}function Ww(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return al(pa)}function Uw(i,l){if(i==="click")return al(l)}function Hw(i,l){if(i==="input"||i==="change")return al(l)}function Vw(i,l){return i===l&&(i!==0||1/i===1/l)||i!==i&&l!==l}var Ln=typeof Object.is=="function"?Object.is:Vw;function fa(i,l){if(Ln(i,l))return!0;if(typeof i!="object"||i===null||typeof l!="object"||l===null)return!1;var h=Object.keys(i),g=Object.keys(l);if(h.length!==g.length)return!1;for(g=0;g<h.length;g++){var j=h[g];if(!d.call(l,j)||!Ln(i[j],l[j]))return!1}return!0}function b1(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function w1(i,l){var h=b1(i);i=0;for(var g;h;){if(h.nodeType===3){if(g=i+h.textContent.length,i<=l&&g>=l)return{node:h,offset:l-i};i=g}e:{for(;h;){if(h.nextSibling){h=h.nextSibling;break e}h=h.parentNode}h=void 0}h=b1(h)}}function N1(i,l){return i&&l?i===l?!0:i&&i.nodeType===3?!1:l&&l.nodeType===3?N1(i,l.parentNode):"contains"in i?i.contains(l):i.compareDocumentPosition?!!(i.compareDocumentPosition(l)&16):!1:!1}function S1(){for(var i=window,l=on();l instanceof i.HTMLIFrameElement;){try{var h=typeof l.contentWindow.location.href=="string"}catch{h=!1}if(h)i=l.contentWindow;else break;l=on(i.document)}return l}function Zu(i){var l=i&&i.nodeName&&i.nodeName.toLowerCase();return l&&(l==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||l==="textarea"||i.contentEditable==="true")}function Kw(i){var l=S1(),h=i.focusedElem,g=i.selectionRange;if(l!==h&&h&&h.ownerDocument&&N1(h.ownerDocument.documentElement,h)){if(g!==null&&Zu(h)){if(l=g.start,i=g.end,i===void 0&&(i=l),"selectionStart"in h)h.selectionStart=l,h.selectionEnd=Math.min(i,h.value.length);else if(i=(l=h.ownerDocument||document)&&l.defaultView||window,i.getSelection){i=i.getSelection();var j=h.textContent.length,w=Math.min(g.start,j);g=g.end===void 0?w:Math.min(g.end,j),!i.extend&&w>g&&(j=g,g=w,w=j),j=w1(h,w);var E=w1(h,g);j&&E&&(i.rangeCount!==1||i.anchorNode!==j.node||i.anchorOffset!==j.offset||i.focusNode!==E.node||i.focusOffset!==E.offset)&&(l=l.createRange(),l.setStart(j.node,j.offset),i.removeAllRanges(),w>g?(i.addRange(l),i.extend(E.node,E.offset)):(l.setEnd(E.node,E.offset),i.addRange(l)))}}for(l=[],i=h;i=i.parentNode;)i.nodeType===1&&l.push({element:i,left:i.scrollLeft,top:i.scrollTop});for(typeof h.focus=="function"&&h.focus(),h=0;h<l.length;h++)i=l[h],i.element.scrollLeft=i.left,i.element.scrollTop=i.top}}var Yw=u&&"documentMode"in document&&11>=document.documentMode,si=null,Xu=null,ma=null,Ju=!1;function C1(i,l,h){var g=h.window===h?h.document:h.nodeType===9?h:h.ownerDocument;Ju||si==null||si!==on(g)||(g=si,"selectionStart"in g&&Zu(g)?g={start:g.selectionStart,end:g.selectionEnd}:(g=(g.ownerDocument&&g.ownerDocument.defaultView||window).getSelection(),g={anchorNode:g.anchorNode,anchorOffset:g.anchorOffset,focusNode:g.focusNode,focusOffset:g.focusOffset}),ma&&fa(ma,g)||(ma=g,g=ul(Xu,"onSelect"),0<g.length&&(l=new Wu("onSelect","select",null,l,h),i.push({event:l,listeners:g}),l.target=si)))}function ol(i,l){var h={};return h[i.toLowerCase()]=l.toLowerCase(),h["Webkit"+i]="webkit"+l,h["Moz"+i]="moz"+l,h}var ri={animationend:ol("Animation","AnimationEnd"),animationiteration:ol("Animation","AnimationIteration"),animationstart:ol("Animation","AnimationStart"),transitionend:ol("Transition","TransitionEnd")},ed={},$1={};u&&($1=document.createElement("div").style,"AnimationEvent"in window||(delete ri.animationend.animation,delete ri.animationiteration.animation,delete ri.animationstart.animation),"TransitionEvent"in window||delete ri.transitionend.transition);function ll(i){if(ed[i])return ed[i];if(!ri[i])return i;var l=ri[i],h;for(h in l)if(l.hasOwnProperty(h)&&h in $1)return ed[i]=l[h];return i}var E1=ll("animationend"),T1=ll("animationiteration"),A1=ll("animationstart"),P1=ll("transitionend"),R1=new Map,I1="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Ds(i,l){R1.set(i,l),o(l,[i])}for(var td=0;td<I1.length;td++){var nd=I1[td],Qw=nd.toLowerCase(),Gw=nd[0].toUpperCase()+nd.slice(1);Ds(Qw,"on"+Gw)}Ds(E1,"onAnimationEnd"),Ds(T1,"onAnimationIteration"),Ds(A1,"onAnimationStart"),Ds("dblclick","onDoubleClick"),Ds("focusin","onFocus"),Ds("focusout","onBlur"),Ds(P1,"onTransitionEnd"),c("onMouseEnter",["mouseout","mouseover"]),c("onMouseLeave",["mouseout","mouseover"]),c("onPointerEnter",["pointerout","pointerover"]),c("onPointerLeave",["pointerout","pointerover"]),o("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),o("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),o("onBeforeInput",["compositionend","keypress","textInput","paste"]),o("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),o("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),o("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ga="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Zw=new Set("cancel close invalid load scroll toggle".split(" ").concat(ga));function z1(i,l,h){var g=i.type||"unknown-event";i.currentTarget=h,Qb(g,l,void 0,i),i.currentTarget=null}function M1(i,l){l=(l&4)!==0;for(var h=0;h<i.length;h++){var g=i[h],j=g.event;g=g.listeners;e:{var w=void 0;if(l)for(var E=g.length-1;0<=E;E--){var L=g[E],W=L.instance,Z=L.currentTarget;if(L=L.listener,W!==w&&j.isPropagationStopped())break e;z1(j,L,Z),w=W}else for(E=0;E<g.length;E++){if(L=g[E],W=L.instance,Z=L.currentTarget,L=L.listener,W!==w&&j.isPropagationStopped())break e;z1(j,L,Z),w=W}}}if(Vo)throw i=Iu,Vo=!1,Iu=null,i}function Je(i,l){var h=l[ud];h===void 0&&(h=l[ud]=new Set);var g=i+"__bubble";h.has(g)||(F1(l,i,2,!1),h.add(g))}function sd(i,l,h){var g=0;l&&(g|=4),F1(h,i,g,l)}var cl="_reactListening"+Math.random().toString(36).slice(2);function xa(i){if(!i[cl]){i[cl]=!0,r.forEach(function(h){h!=="selectionchange"&&(Zw.has(h)||sd(h,!1,i),sd(h,!0,i))});var l=i.nodeType===9?i:i.ownerDocument;l===null||l[cl]||(l[cl]=!0,sd("selectionchange",!1,l))}}function F1(i,l,h,g){switch(i1(l)){case 1:var j=dw;break;case 4:j=hw;break;default:j=qu}h=j.bind(null,l,h,i),j=void 0,!Ru||l!=="touchstart"&&l!=="touchmove"&&l!=="wheel"||(j=!0),g?j!==void 0?i.addEventListener(l,h,{capture:!0,passive:j}):i.addEventListener(l,h,!0):j!==void 0?i.addEventListener(l,h,{passive:j}):i.addEventListener(l,h,!1)}function rd(i,l,h,g,j){var w=g;if((l&1)===0&&(l&2)===0&&g!==null)e:for(;;){if(g===null)return;var E=g.tag;if(E===3||E===4){var L=g.stateNode.containerInfo;if(L===j||L.nodeType===8&&L.parentNode===j)break;if(E===4)for(E=g.return;E!==null;){var W=E.tag;if((W===3||W===4)&&(W=E.stateNode.containerInfo,W===j||W.nodeType===8&&W.parentNode===j))return;E=E.return}for(;L!==null;){if(E=mr(L),E===null)return;if(W=E.tag,W===5||W===6){g=w=E;continue e}L=L.parentNode}}g=g.return}Dm(function(){var Z=w,ie=Tu(h),oe=[];e:{var re=R1.get(i);if(re!==void 0){var fe=Wu,ye=i;switch(i){case"keypress":if(sl(h)===0)break e;case"keydown":case"keyup":fe=$w;break;case"focusin":ye="focus",fe=Vu;break;case"focusout":ye="blur",fe=Vu;break;case"beforeblur":case"afterblur":fe=Vu;break;case"click":if(h.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":fe=l1;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":fe=mw;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":fe=Aw;break;case E1:case T1:case A1:fe=yw;break;case P1:fe=Rw;break;case"scroll":fe=pw;break;case"wheel":fe=zw;break;case"copy":case"cut":case"paste":fe=vw;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":fe=u1}var ve=(l&4)!==0,dt=!ve&&i==="scroll",Y=ve?re!==null?re+"Capture":null:re;ve=[];for(var U=Z,G;U!==null;){G=U;var de=G.stateNode;if(G.tag===5&&de!==null&&(G=de,Y!==null&&(de=Ji(U,Y),de!=null&&ve.push(ya(U,de,G)))),dt)break;U=U.return}0<ve.length&&(re=new fe(re,ye,null,h,ie),oe.push({event:re,listeners:ve}))}}if((l&7)===0){e:{if(re=i==="mouseover"||i==="pointerover",fe=i==="mouseout"||i==="pointerout",re&&h!==un&&(ye=h.relatedTarget||h.fromElement)&&(mr(ye)||ye[fs]))break e;if((fe||re)&&(re=ie.window===ie?ie:(re=ie.ownerDocument)?re.defaultView||re.parentWindow:window,fe?(ye=h.relatedTarget||h.toElement,fe=Z,ye=ye?mr(ye):null,ye!==null&&(dt=fr(ye),ye!==dt||ye.tag!==5&&ye.tag!==6)&&(ye=null)):(fe=null,ye=Z),fe!==ye)){if(ve=l1,de="onMouseLeave",Y="onMouseEnter",U="mouse",(i==="pointerout"||i==="pointerover")&&(ve=u1,de="onPointerLeave",Y="onPointerEnter",U="pointer"),dt=fe==null?re:oi(fe),G=ye==null?re:oi(ye),re=new ve(de,U+"leave",fe,h,ie),re.target=dt,re.relatedTarget=G,de=null,mr(ie)===Z&&(ve=new ve(Y,U+"enter",ye,h,ie),ve.target=G,ve.relatedTarget=dt,de=ve),dt=de,fe&&ye)t:{for(ve=fe,Y=ye,U=0,G=ve;G;G=ii(G))U++;for(G=0,de=Y;de;de=ii(de))G++;for(;0<U-G;)ve=ii(ve),U--;for(;0<G-U;)Y=ii(Y),G--;for(;U--;){if(ve===Y||Y!==null&&ve===Y.alternate)break t;ve=ii(ve),Y=ii(Y)}ve=null}else ve=null;fe!==null&&L1(oe,re,fe,ve,!1),ye!==null&&dt!==null&&L1(oe,dt,ye,ve,!0)}}e:{if(re=Z?oi(Z):window,fe=re.nodeName&&re.nodeName.toLowerCase(),fe==="select"||fe==="input"&&re.type==="file")var je=Dw;else if(g1(re))if(y1)je=Hw;else{je=Ww;var Ne=Bw}else(fe=re.nodeName)&&fe.toLowerCase()==="input"&&(re.type==="checkbox"||re.type==="radio")&&(je=Uw);if(je&&(je=je(i,Z))){x1(oe,je,h,ie);break e}Ne&&Ne(i,re,Z),i==="focusout"&&(Ne=re._wrapperState)&&Ne.controlled&&re.type==="number"&&Vt(re,"number",re.value)}switch(Ne=Z?oi(Z):window,i){case"focusin":(g1(Ne)||Ne.contentEditable==="true")&&(si=Ne,Xu=Z,ma=null);break;case"focusout":ma=Xu=si=null;break;case"mousedown":Ju=!0;break;case"contextmenu":case"mouseup":case"dragend":Ju=!1,C1(oe,h,ie);break;case"selectionchange":if(Yw)break;case"keydown":case"keyup":C1(oe,h,ie)}var Se;if(Yu)e:{switch(i){case"compositionstart":var Ie="onCompositionStart";break e;case"compositionend":Ie="onCompositionEnd";break e;case"compositionupdate":Ie="onCompositionUpdate";break e}Ie=void 0}else ni?f1(i,h)&&(Ie="onCompositionEnd"):i==="keydown"&&h.keyCode===229&&(Ie="onCompositionStart");Ie&&(d1&&h.locale!=="ko"&&(ni||Ie!=="onCompositionStart"?Ie==="onCompositionEnd"&&ni&&(Se=a1()):(qs=ie,Bu="value"in qs?qs.value:qs.textContent,ni=!0)),Ne=ul(Z,Ie),0<Ne.length&&(Ie=new c1(Ie,i,null,h,ie),oe.push({event:Ie,listeners:Ne}),Se?Ie.data=Se:(Se=m1(h),Se!==null&&(Ie.data=Se)))),(Se=Fw?Lw(i,h):_w(i,h))&&(Z=ul(Z,"onBeforeInput"),0<Z.length&&(ie=new c1("onBeforeInput","beforeinput",null,h,ie),oe.push({event:ie,listeners:Z}),ie.data=Se))}M1(oe,l)})}function ya(i,l,h){return{instance:i,listener:l,currentTarget:h}}function ul(i,l){for(var h=l+"Capture",g=[];i!==null;){var j=i,w=j.stateNode;j.tag===5&&w!==null&&(j=w,w=Ji(i,h),w!=null&&g.unshift(ya(i,w,j)),w=Ji(i,l),w!=null&&g.push(ya(i,w,j))),i=i.return}return g}function ii(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5);return i||null}function L1(i,l,h,g,j){for(var w=l._reactName,E=[];h!==null&&h!==g;){var L=h,W=L.alternate,Z=L.stateNode;if(W!==null&&W===g)break;L.tag===5&&Z!==null&&(L=Z,j?(W=Ji(h,w),W!=null&&E.unshift(ya(h,W,L))):j||(W=Ji(h,w),W!=null&&E.push(ya(h,W,L)))),h=h.return}E.length!==0&&i.push({event:l,listeners:E})}var Xw=/\r\n?/g,Jw=/\u0000|\uFFFD/g;function _1(i){return(typeof i=="string"?i:""+i).replace(Xw,`
38
- `).replace(Jw,"")}function dl(i,l,h){if(l=_1(l),_1(i)!==l&&h)throw Error(s(425))}function hl(){}var id=null,ad=null;function od(i,l){return i==="textarea"||i==="noscript"||typeof l.children=="string"||typeof l.children=="number"||typeof l.dangerouslySetInnerHTML=="object"&&l.dangerouslySetInnerHTML!==null&&l.dangerouslySetInnerHTML.__html!=null}var ld=typeof setTimeout=="function"?setTimeout:void 0,e3=typeof clearTimeout=="function"?clearTimeout:void 0,O1=typeof Promise=="function"?Promise:void 0,t3=typeof queueMicrotask=="function"?queueMicrotask:typeof O1<"u"?function(i){return O1.resolve(null).then(i).catch(n3)}:ld;function n3(i){setTimeout(function(){throw i})}function cd(i,l){var h=l,g=0;do{var j=h.nextSibling;if(i.removeChild(h),j&&j.nodeType===8)if(h=j.data,h==="/$"){if(g===0){i.removeChild(j),la(l);return}g--}else h!=="$"&&h!=="$?"&&h!=="$!"||g++;h=j}while(h);la(l)}function Bs(i){for(;i!=null;i=i.nextSibling){var l=i.nodeType;if(l===1||l===3)break;if(l===8){if(l=i.data,l==="$"||l==="$!"||l==="$?")break;if(l==="/$")return null}}return i}function q1(i){i=i.previousSibling;for(var l=0;i;){if(i.nodeType===8){var h=i.data;if(h==="$"||h==="$!"||h==="$?"){if(l===0)return i;l--}else h==="/$"&&l++}i=i.previousSibling}return null}var ai=Math.random().toString(36).slice(2),Xn="__reactFiber$"+ai,ka="__reactProps$"+ai,fs="__reactContainer$"+ai,ud="__reactEvents$"+ai,s3="__reactListeners$"+ai,r3="__reactHandles$"+ai;function mr(i){var l=i[Xn];if(l)return l;for(var h=i.parentNode;h;){if(l=h[fs]||h[Xn]){if(h=l.alternate,l.child!==null||h!==null&&h.child!==null)for(i=q1(i);i!==null;){if(h=i[Xn])return h;i=q1(i)}return l}i=h,h=i.parentNode}return null}function va(i){return i=i[Xn]||i[fs],!i||i.tag!==5&&i.tag!==6&&i.tag!==13&&i.tag!==3?null:i}function oi(i){if(i.tag===5||i.tag===6)return i.stateNode;throw Error(s(33))}function pl(i){return i[ka]||null}var dd=[],li=-1;function Ws(i){return{current:i}}function et(i){0>li||(i.current=dd[li],dd[li]=null,li--)}function Ge(i,l){li++,dd[li]=i.current,i.current=l}var Us={},Pt=Ws(Us),Kt=Ws(!1),gr=Us;function ci(i,l){var h=i.type.contextTypes;if(!h)return Us;var g=i.stateNode;if(g&&g.__reactInternalMemoizedUnmaskedChildContext===l)return g.__reactInternalMemoizedMaskedChildContext;var j={},w;for(w in h)j[w]=l[w];return g&&(i=i.stateNode,i.__reactInternalMemoizedUnmaskedChildContext=l,i.__reactInternalMemoizedMaskedChildContext=j),j}function Yt(i){return i=i.childContextTypes,i!=null}function fl(){et(Kt),et(Pt)}function D1(i,l,h){if(Pt.current!==Us)throw Error(s(168));Ge(Pt,l),Ge(Kt,h)}function B1(i,l,h){var g=i.stateNode;if(l=l.childContextTypes,typeof g.getChildContext!="function")return h;g=g.getChildContext();for(var j in g)if(!(j in l))throw Error(s(108,Re(i)||"Unknown",j));return A({},h,g)}function ml(i){return i=(i=i.stateNode)&&i.__reactInternalMemoizedMergedChildContext||Us,gr=Pt.current,Ge(Pt,i),Ge(Kt,Kt.current),!0}function W1(i,l,h){var g=i.stateNode;if(!g)throw Error(s(169));h?(i=B1(i,l,gr),g.__reactInternalMemoizedMergedChildContext=i,et(Kt),et(Pt),Ge(Pt,i)):et(Kt),Ge(Kt,h)}var ms=null,gl=!1,hd=!1;function U1(i){ms===null?ms=[i]:ms.push(i)}function i3(i){gl=!0,U1(i)}function Hs(){if(!hd&&ms!==null){hd=!0;var i=0,l=Ke;try{var h=ms;for(Ke=1;i<h.length;i++){var g=h[i];do g=g(!0);while(g!==null)}ms=null,gl=!1}catch(j){throw ms!==null&&(ms=ms.slice(i+1)),Vm(zu,Hs),j}finally{Ke=l,hd=!1}}return null}var ui=[],di=0,xl=null,yl=0,wn=[],Nn=0,xr=null,gs=1,xs="";function yr(i,l){ui[di++]=yl,ui[di++]=xl,xl=i,yl=l}function H1(i,l,h){wn[Nn++]=gs,wn[Nn++]=xs,wn[Nn++]=xr,xr=i;var g=gs;i=xs;var j=32-Fn(g)-1;g&=~(1<<j),h+=1;var w=32-Fn(l)+j;if(30<w){var E=j-j%5;w=(g&(1<<E)-1).toString(32),g>>=E,j-=E,gs=1<<32-Fn(l)+j|h<<j|g,xs=w+i}else gs=1<<w|h<<j|g,xs=i}function pd(i){i.return!==null&&(yr(i,1),H1(i,1,0))}function fd(i){for(;i===xl;)xl=ui[--di],ui[di]=null,yl=ui[--di],ui[di]=null;for(;i===xr;)xr=wn[--Nn],wn[Nn]=null,xs=wn[--Nn],wn[Nn]=null,gs=wn[--Nn],wn[Nn]=null}var hn=null,pn=null,tt=!1,_n=null;function V1(i,l){var h=En(5,null,null,0);h.elementType="DELETED",h.stateNode=l,h.return=i,l=i.deletions,l===null?(i.deletions=[h],i.flags|=16):l.push(h)}function K1(i,l){switch(i.tag){case 5:var h=i.type;return l=l.nodeType!==1||h.toLowerCase()!==l.nodeName.toLowerCase()?null:l,l!==null?(i.stateNode=l,hn=i,pn=Bs(l.firstChild),!0):!1;case 6:return l=i.pendingProps===""||l.nodeType!==3?null:l,l!==null?(i.stateNode=l,hn=i,pn=null,!0):!1;case 13:return l=l.nodeType!==8?null:l,l!==null?(h=xr!==null?{id:gs,overflow:xs}:null,i.memoizedState={dehydrated:l,treeContext:h,retryLane:1073741824},h=En(18,null,null,0),h.stateNode=l,h.return=i,i.child=h,hn=i,pn=null,!0):!1;default:return!1}}function md(i){return(i.mode&1)!==0&&(i.flags&128)===0}function gd(i){if(tt){var l=pn;if(l){var h=l;if(!K1(i,l)){if(md(i))throw Error(s(418));l=Bs(h.nextSibling);var g=hn;l&&K1(i,l)?V1(g,h):(i.flags=i.flags&-4097|2,tt=!1,hn=i)}}else{if(md(i))throw Error(s(418));i.flags=i.flags&-4097|2,tt=!1,hn=i}}}function Y1(i){for(i=i.return;i!==null&&i.tag!==5&&i.tag!==3&&i.tag!==13;)i=i.return;hn=i}function kl(i){if(i!==hn)return!1;if(!tt)return Y1(i),tt=!0,!1;var l;if((l=i.tag!==3)&&!(l=i.tag!==5)&&(l=i.type,l=l!=="head"&&l!=="body"&&!od(i.type,i.memoizedProps)),l&&(l=pn)){if(md(i))throw Q1(),Error(s(418));for(;l;)V1(i,l),l=Bs(l.nextSibling)}if(Y1(i),i.tag===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(s(317));e:{for(i=i.nextSibling,l=0;i;){if(i.nodeType===8){var h=i.data;if(h==="/$"){if(l===0){pn=Bs(i.nextSibling);break e}l--}else h!=="$"&&h!=="$!"&&h!=="$?"||l++}i=i.nextSibling}pn=null}}else pn=hn?Bs(i.stateNode.nextSibling):null;return!0}function Q1(){for(var i=pn;i;)i=Bs(i.nextSibling)}function hi(){pn=hn=null,tt=!1}function xd(i){_n===null?_n=[i]:_n.push(i)}var a3=P.ReactCurrentBatchConfig;function ja(i,l,h){if(i=h.ref,i!==null&&typeof i!="function"&&typeof i!="object"){if(h._owner){if(h=h._owner,h){if(h.tag!==1)throw Error(s(309));var g=h.stateNode}if(!g)throw Error(s(147,i));var j=g,w=""+i;return l!==null&&l.ref!==null&&typeof l.ref=="function"&&l.ref._stringRef===w?l.ref:(l=function(E){var L=j.refs;E===null?delete L[w]:L[w]=E},l._stringRef=w,l)}if(typeof i!="string")throw Error(s(284));if(!h._owner)throw Error(s(290,i))}return i}function vl(i,l){throw i=Object.prototype.toString.call(l),Error(s(31,i==="[object Object]"?"object with keys {"+Object.keys(l).join(", ")+"}":i))}function G1(i){var l=i._init;return l(i._payload)}function Z1(i){function l(Y,U){if(i){var G=Y.deletions;G===null?(Y.deletions=[U],Y.flags|=16):G.push(U)}}function h(Y,U){if(!i)return null;for(;U!==null;)l(Y,U),U=U.sibling;return null}function g(Y,U){for(Y=new Map;U!==null;)U.key!==null?Y.set(U.key,U):Y.set(U.index,U),U=U.sibling;return Y}function j(Y,U){return Y=Js(Y,U),Y.index=0,Y.sibling=null,Y}function w(Y,U,G){return Y.index=G,i?(G=Y.alternate,G!==null?(G=G.index,G<U?(Y.flags|=2,U):G):(Y.flags|=2,U)):(Y.flags|=1048576,U)}function E(Y){return i&&Y.alternate===null&&(Y.flags|=2),Y}function L(Y,U,G,de){return U===null||U.tag!==6?(U=lh(G,Y.mode,de),U.return=Y,U):(U=j(U,G),U.return=Y,U)}function W(Y,U,G,de){var je=G.type;return je===F?ie(Y,U,G.props.children,de,G.key):U!==null&&(U.elementType===je||typeof je=="object"&&je!==null&&je.$$typeof===ce&&G1(je)===U.type)?(de=j(U,G.props),de.ref=ja(Y,U,G),de.return=Y,de):(de=Ul(G.type,G.key,G.props,null,Y.mode,de),de.ref=ja(Y,U,G),de.return=Y,de)}function Z(Y,U,G,de){return U===null||U.tag!==4||U.stateNode.containerInfo!==G.containerInfo||U.stateNode.implementation!==G.implementation?(U=ch(G,Y.mode,de),U.return=Y,U):(U=j(U,G.children||[]),U.return=Y,U)}function ie(Y,U,G,de,je){return U===null||U.tag!==7?(U=Cr(G,Y.mode,de,je),U.return=Y,U):(U=j(U,G),U.return=Y,U)}function oe(Y,U,G){if(typeof U=="string"&&U!==""||typeof U=="number")return U=lh(""+U,Y.mode,G),U.return=Y,U;if(typeof U=="object"&&U!==null){switch(U.$$typeof){case M:return G=Ul(U.type,U.key,U.props,null,Y.mode,G),G.ref=ja(Y,null,U),G.return=Y,G;case T:return U=ch(U,Y.mode,G),U.return=Y,U;case ce:var de=U._init;return oe(Y,de(U._payload),G)}if(xt(U)||ne(U))return U=Cr(U,Y.mode,G,null),U.return=Y,U;vl(Y,U)}return null}function re(Y,U,G,de){var je=U!==null?U.key:null;if(typeof G=="string"&&G!==""||typeof G=="number")return je!==null?null:L(Y,U,""+G,de);if(typeof G=="object"&&G!==null){switch(G.$$typeof){case M:return G.key===je?W(Y,U,G,de):null;case T:return G.key===je?Z(Y,U,G,de):null;case ce:return je=G._init,re(Y,U,je(G._payload),de)}if(xt(G)||ne(G))return je!==null?null:ie(Y,U,G,de,null);vl(Y,G)}return null}function fe(Y,U,G,de,je){if(typeof de=="string"&&de!==""||typeof de=="number")return Y=Y.get(G)||null,L(U,Y,""+de,je);if(typeof de=="object"&&de!==null){switch(de.$$typeof){case M:return Y=Y.get(de.key===null?G:de.key)||null,W(U,Y,de,je);case T:return Y=Y.get(de.key===null?G:de.key)||null,Z(U,Y,de,je);case ce:var Ne=de._init;return fe(Y,U,G,Ne(de._payload),je)}if(xt(de)||ne(de))return Y=Y.get(G)||null,ie(U,Y,de,je,null);vl(U,de)}return null}function ye(Y,U,G,de){for(var je=null,Ne=null,Se=U,Ie=U=0,jt=null;Se!==null&&Ie<G.length;Ie++){Se.index>Ie?(jt=Se,Se=null):jt=Se.sibling;var Ue=re(Y,Se,G[Ie],de);if(Ue===null){Se===null&&(Se=jt);break}i&&Se&&Ue.alternate===null&&l(Y,Se),U=w(Ue,U,Ie),Ne===null?je=Ue:Ne.sibling=Ue,Ne=Ue,Se=jt}if(Ie===G.length)return h(Y,Se),tt&&yr(Y,Ie),je;if(Se===null){for(;Ie<G.length;Ie++)Se=oe(Y,G[Ie],de),Se!==null&&(U=w(Se,U,Ie),Ne===null?je=Se:Ne.sibling=Se,Ne=Se);return tt&&yr(Y,Ie),je}for(Se=g(Y,Se);Ie<G.length;Ie++)jt=fe(Se,Y,Ie,G[Ie],de),jt!==null&&(i&&jt.alternate!==null&&Se.delete(jt.key===null?Ie:jt.key),U=w(jt,U,Ie),Ne===null?je=jt:Ne.sibling=jt,Ne=jt);return i&&Se.forEach(function(er){return l(Y,er)}),tt&&yr(Y,Ie),je}function ve(Y,U,G,de){var je=ne(G);if(typeof je!="function")throw Error(s(150));if(G=je.call(G),G==null)throw Error(s(151));for(var Ne=je=null,Se=U,Ie=U=0,jt=null,Ue=G.next();Se!==null&&!Ue.done;Ie++,Ue=G.next()){Se.index>Ie?(jt=Se,Se=null):jt=Se.sibling;var er=re(Y,Se,Ue.value,de);if(er===null){Se===null&&(Se=jt);break}i&&Se&&er.alternate===null&&l(Y,Se),U=w(er,U,Ie),Ne===null?je=er:Ne.sibling=er,Ne=er,Se=jt}if(Ue.done)return h(Y,Se),tt&&yr(Y,Ie),je;if(Se===null){for(;!Ue.done;Ie++,Ue=G.next())Ue=oe(Y,Ue.value,de),Ue!==null&&(U=w(Ue,U,Ie),Ne===null?je=Ue:Ne.sibling=Ue,Ne=Ue);return tt&&yr(Y,Ie),je}for(Se=g(Y,Se);!Ue.done;Ie++,Ue=G.next())Ue=fe(Se,Y,Ie,Ue.value,de),Ue!==null&&(i&&Ue.alternate!==null&&Se.delete(Ue.key===null?Ie:Ue.key),U=w(Ue,U,Ie),Ne===null?je=Ue:Ne.sibling=Ue,Ne=Ue);return i&&Se.forEach(function(O3){return l(Y,O3)}),tt&&yr(Y,Ie),je}function dt(Y,U,G,de){if(typeof G=="object"&&G!==null&&G.type===F&&G.key===null&&(G=G.props.children),typeof G=="object"&&G!==null){switch(G.$$typeof){case M:e:{for(var je=G.key,Ne=U;Ne!==null;){if(Ne.key===je){if(je=G.type,je===F){if(Ne.tag===7){h(Y,Ne.sibling),U=j(Ne,G.props.children),U.return=Y,Y=U;break e}}else if(Ne.elementType===je||typeof je=="object"&&je!==null&&je.$$typeof===ce&&G1(je)===Ne.type){h(Y,Ne.sibling),U=j(Ne,G.props),U.ref=ja(Y,Ne,G),U.return=Y,Y=U;break e}h(Y,Ne);break}else l(Y,Ne);Ne=Ne.sibling}G.type===F?(U=Cr(G.props.children,Y.mode,de,G.key),U.return=Y,Y=U):(de=Ul(G.type,G.key,G.props,null,Y.mode,de),de.ref=ja(Y,U,G),de.return=Y,Y=de)}return E(Y);case T:e:{for(Ne=G.key;U!==null;){if(U.key===Ne)if(U.tag===4&&U.stateNode.containerInfo===G.containerInfo&&U.stateNode.implementation===G.implementation){h(Y,U.sibling),U=j(U,G.children||[]),U.return=Y,Y=U;break e}else{h(Y,U);break}else l(Y,U);U=U.sibling}U=ch(G,Y.mode,de),U.return=Y,Y=U}return E(Y);case ce:return Ne=G._init,dt(Y,U,Ne(G._payload),de)}if(xt(G))return ye(Y,U,G,de);if(ne(G))return ve(Y,U,G,de);vl(Y,G)}return typeof G=="string"&&G!==""||typeof G=="number"?(G=""+G,U!==null&&U.tag===6?(h(Y,U.sibling),U=j(U,G),U.return=Y,Y=U):(h(Y,U),U=lh(G,Y.mode,de),U.return=Y,Y=U),E(Y)):h(Y,U)}return dt}var pi=Z1(!0),X1=Z1(!1),jl=Ws(null),bl=null,fi=null,yd=null;function kd(){yd=fi=bl=null}function vd(i){var l=jl.current;et(jl),i._currentValue=l}function jd(i,l,h){for(;i!==null;){var g=i.alternate;if((i.childLanes&l)!==l?(i.childLanes|=l,g!==null&&(g.childLanes|=l)):g!==null&&(g.childLanes&l)!==l&&(g.childLanes|=l),i===h)break;i=i.return}}function mi(i,l){bl=i,yd=fi=null,i=i.dependencies,i!==null&&i.firstContext!==null&&((i.lanes&l)!==0&&(Qt=!0),i.firstContext=null)}function Sn(i){var l=i._currentValue;if(yd!==i)if(i={context:i,memoizedValue:l,next:null},fi===null){if(bl===null)throw Error(s(308));fi=i,bl.dependencies={lanes:0,firstContext:i}}else fi=fi.next=i;return l}var kr=null;function bd(i){kr===null?kr=[i]:kr.push(i)}function J1(i,l,h,g){var j=l.interleaved;return j===null?(h.next=h,bd(l)):(h.next=j.next,j.next=h),l.interleaved=h,ys(i,g)}function ys(i,l){i.lanes|=l;var h=i.alternate;for(h!==null&&(h.lanes|=l),h=i,i=i.return;i!==null;)i.childLanes|=l,h=i.alternate,h!==null&&(h.childLanes|=l),h=i,i=i.return;return h.tag===3?h.stateNode:null}var Vs=!1;function wd(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function e0(i,l){i=i.updateQueue,l.updateQueue===i&&(l.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,effects:i.effects})}function ks(i,l){return{eventTime:i,lane:l,tag:0,payload:null,callback:null,next:null}}function Ks(i,l,h){var g=i.updateQueue;if(g===null)return null;if(g=g.shared,(We&2)!==0){var j=g.pending;return j===null?l.next=l:(l.next=j.next,j.next=l),g.pending=l,ys(i,h)}return j=g.interleaved,j===null?(l.next=l,bd(g)):(l.next=j.next,j.next=l),g.interleaved=l,ys(i,h)}function wl(i,l,h){if(l=l.updateQueue,l!==null&&(l=l.shared,(h&4194240)!==0)){var g=l.lanes;g&=i.pendingLanes,h|=g,l.lanes=h,Lu(i,h)}}function t0(i,l){var h=i.updateQueue,g=i.alternate;if(g!==null&&(g=g.updateQueue,h===g)){var j=null,w=null;if(h=h.firstBaseUpdate,h!==null){do{var E={eventTime:h.eventTime,lane:h.lane,tag:h.tag,payload:h.payload,callback:h.callback,next:null};w===null?j=w=E:w=w.next=E,h=h.next}while(h!==null);w===null?j=w=l:w=w.next=l}else j=w=l;h={baseState:g.baseState,firstBaseUpdate:j,lastBaseUpdate:w,shared:g.shared,effects:g.effects},i.updateQueue=h;return}i=h.lastBaseUpdate,i===null?h.firstBaseUpdate=l:i.next=l,h.lastBaseUpdate=l}function Nl(i,l,h,g){var j=i.updateQueue;Vs=!1;var w=j.firstBaseUpdate,E=j.lastBaseUpdate,L=j.shared.pending;if(L!==null){j.shared.pending=null;var W=L,Z=W.next;W.next=null,E===null?w=Z:E.next=Z,E=W;var ie=i.alternate;ie!==null&&(ie=ie.updateQueue,L=ie.lastBaseUpdate,L!==E&&(L===null?ie.firstBaseUpdate=Z:L.next=Z,ie.lastBaseUpdate=W))}if(w!==null){var oe=j.baseState;E=0,ie=Z=W=null,L=w;do{var re=L.lane,fe=L.eventTime;if((g&re)===re){ie!==null&&(ie=ie.next={eventTime:fe,lane:0,tag:L.tag,payload:L.payload,callback:L.callback,next:null});e:{var ye=i,ve=L;switch(re=l,fe=h,ve.tag){case 1:if(ye=ve.payload,typeof ye=="function"){oe=ye.call(fe,oe,re);break e}oe=ye;break e;case 3:ye.flags=ye.flags&-65537|128;case 0:if(ye=ve.payload,re=typeof ye=="function"?ye.call(fe,oe,re):ye,re==null)break e;oe=A({},oe,re);break e;case 2:Vs=!0}}L.callback!==null&&L.lane!==0&&(i.flags|=64,re=j.effects,re===null?j.effects=[L]:re.push(L))}else fe={eventTime:fe,lane:re,tag:L.tag,payload:L.payload,callback:L.callback,next:null},ie===null?(Z=ie=fe,W=oe):ie=ie.next=fe,E|=re;if(L=L.next,L===null){if(L=j.shared.pending,L===null)break;re=L,L=re.next,re.next=null,j.lastBaseUpdate=re,j.shared.pending=null}}while(!0);if(ie===null&&(W=oe),j.baseState=W,j.firstBaseUpdate=Z,j.lastBaseUpdate=ie,l=j.shared.interleaved,l!==null){j=l;do E|=j.lane,j=j.next;while(j!==l)}else w===null&&(j.shared.lanes=0);br|=E,i.lanes=E,i.memoizedState=oe}}function n0(i,l,h){if(i=l.effects,l.effects=null,i!==null)for(l=0;l<i.length;l++){var g=i[l],j=g.callback;if(j!==null){if(g.callback=null,g=h,typeof j!="function")throw Error(s(191,j));j.call(g)}}}var ba={},Jn=Ws(ba),wa=Ws(ba),Na=Ws(ba);function vr(i){if(i===ba)throw Error(s(174));return i}function Nd(i,l){switch(Ge(Na,l),Ge(wa,i),Ge(Jn,ba),i=l.nodeType,i){case 9:case 11:l=(l=l.documentElement)?l.namespaceURI:le(null,"");break;default:i=i===8?l.parentNode:l,l=i.namespaceURI||null,i=i.tagName,l=le(l,i)}et(Jn),Ge(Jn,l)}function gi(){et(Jn),et(wa),et(Na)}function s0(i){vr(Na.current);var l=vr(Jn.current),h=le(l,i.type);l!==h&&(Ge(wa,i),Ge(Jn,h))}function Sd(i){wa.current===i&&(et(Jn),et(wa))}var rt=Ws(0);function Sl(i){for(var l=i;l!==null;){if(l.tag===13){var h=l.memoizedState;if(h!==null&&(h=h.dehydrated,h===null||h.data==="$?"||h.data==="$!"))return l}else if(l.tag===19&&l.memoizedProps.revealOrder!==void 0){if((l.flags&128)!==0)return l}else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===i)break;for(;l.sibling===null;){if(l.return===null||l.return===i)return null;l=l.return}l.sibling.return=l.return,l=l.sibling}return null}var Cd=[];function $d(){for(var i=0;i<Cd.length;i++)Cd[i]._workInProgressVersionPrimary=null;Cd.length=0}var Cl=P.ReactCurrentDispatcher,Ed=P.ReactCurrentBatchConfig,jr=0,it=null,ft=null,kt=null,$l=!1,Sa=!1,Ca=0,o3=0;function Rt(){throw Error(s(321))}function Td(i,l){if(l===null)return!1;for(var h=0;h<l.length&&h<i.length;h++)if(!Ln(i[h],l[h]))return!1;return!0}function Ad(i,l,h,g,j,w){if(jr=w,it=l,l.memoizedState=null,l.updateQueue=null,l.lanes=0,Cl.current=i===null||i.memoizedState===null?d3:h3,i=h(g,j),Sa){w=0;do{if(Sa=!1,Ca=0,25<=w)throw Error(s(301));w+=1,kt=ft=null,l.updateQueue=null,Cl.current=p3,i=h(g,j)}while(Sa)}if(Cl.current=Al,l=ft!==null&&ft.next!==null,jr=0,kt=ft=it=null,$l=!1,l)throw Error(s(300));return i}function Pd(){var i=Ca!==0;return Ca=0,i}function es(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return kt===null?it.memoizedState=kt=i:kt=kt.next=i,kt}function Cn(){if(ft===null){var i=it.alternate;i=i!==null?i.memoizedState:null}else i=ft.next;var l=kt===null?it.memoizedState:kt.next;if(l!==null)kt=l,ft=i;else{if(i===null)throw Error(s(310));ft=i,i={memoizedState:ft.memoizedState,baseState:ft.baseState,baseQueue:ft.baseQueue,queue:ft.queue,next:null},kt===null?it.memoizedState=kt=i:kt=kt.next=i}return kt}function $a(i,l){return typeof l=="function"?l(i):l}function Rd(i){var l=Cn(),h=l.queue;if(h===null)throw Error(s(311));h.lastRenderedReducer=i;var g=ft,j=g.baseQueue,w=h.pending;if(w!==null){if(j!==null){var E=j.next;j.next=w.next,w.next=E}g.baseQueue=j=w,h.pending=null}if(j!==null){w=j.next,g=g.baseState;var L=E=null,W=null,Z=w;do{var ie=Z.lane;if((jr&ie)===ie)W!==null&&(W=W.next={lane:0,action:Z.action,hasEagerState:Z.hasEagerState,eagerState:Z.eagerState,next:null}),g=Z.hasEagerState?Z.eagerState:i(g,Z.action);else{var oe={lane:ie,action:Z.action,hasEagerState:Z.hasEagerState,eagerState:Z.eagerState,next:null};W===null?(L=W=oe,E=g):W=W.next=oe,it.lanes|=ie,br|=ie}Z=Z.next}while(Z!==null&&Z!==w);W===null?E=g:W.next=L,Ln(g,l.memoizedState)||(Qt=!0),l.memoizedState=g,l.baseState=E,l.baseQueue=W,h.lastRenderedState=g}if(i=h.interleaved,i!==null){j=i;do w=j.lane,it.lanes|=w,br|=w,j=j.next;while(j!==i)}else j===null&&(h.lanes=0);return[l.memoizedState,h.dispatch]}function Id(i){var l=Cn(),h=l.queue;if(h===null)throw Error(s(311));h.lastRenderedReducer=i;var g=h.dispatch,j=h.pending,w=l.memoizedState;if(j!==null){h.pending=null;var E=j=j.next;do w=i(w,E.action),E=E.next;while(E!==j);Ln(w,l.memoizedState)||(Qt=!0),l.memoizedState=w,l.baseQueue===null&&(l.baseState=w),h.lastRenderedState=w}return[w,g]}function r0(){}function i0(i,l){var h=it,g=Cn(),j=l(),w=!Ln(g.memoizedState,j);if(w&&(g.memoizedState=j,Qt=!0),g=g.queue,zd(l0.bind(null,h,g,i),[i]),g.getSnapshot!==l||w||kt!==null&&kt.memoizedState.tag&1){if(h.flags|=2048,Ea(9,o0.bind(null,h,g,j,l),void 0,null),vt===null)throw Error(s(349));(jr&30)!==0||a0(h,l,j)}return j}function a0(i,l,h){i.flags|=16384,i={getSnapshot:l,value:h},l=it.updateQueue,l===null?(l={lastEffect:null,stores:null},it.updateQueue=l,l.stores=[i]):(h=l.stores,h===null?l.stores=[i]:h.push(i))}function o0(i,l,h,g){l.value=h,l.getSnapshot=g,c0(l)&&u0(i)}function l0(i,l,h){return h(function(){c0(l)&&u0(i)})}function c0(i){var l=i.getSnapshot;i=i.value;try{var h=l();return!Ln(i,h)}catch{return!0}}function u0(i){var l=ys(i,1);l!==null&&Bn(l,i,1,-1)}function d0(i){var l=es();return typeof i=="function"&&(i=i()),l.memoizedState=l.baseState=i,i={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:$a,lastRenderedState:i},l.queue=i,i=i.dispatch=u3.bind(null,it,i),[l.memoizedState,i]}function Ea(i,l,h,g){return i={tag:i,create:l,destroy:h,deps:g,next:null},l=it.updateQueue,l===null?(l={lastEffect:null,stores:null},it.updateQueue=l,l.lastEffect=i.next=i):(h=l.lastEffect,h===null?l.lastEffect=i.next=i:(g=h.next,h.next=i,i.next=g,l.lastEffect=i)),i}function h0(){return Cn().memoizedState}function El(i,l,h,g){var j=es();it.flags|=i,j.memoizedState=Ea(1|l,h,void 0,g===void 0?null:g)}function Tl(i,l,h,g){var j=Cn();g=g===void 0?null:g;var w=void 0;if(ft!==null){var E=ft.memoizedState;if(w=E.destroy,g!==null&&Td(g,E.deps)){j.memoizedState=Ea(l,h,w,g);return}}it.flags|=i,j.memoizedState=Ea(1|l,h,w,g)}function p0(i,l){return El(8390656,8,i,l)}function zd(i,l){return Tl(2048,8,i,l)}function f0(i,l){return Tl(4,2,i,l)}function m0(i,l){return Tl(4,4,i,l)}function g0(i,l){if(typeof l=="function")return i=i(),l(i),function(){l(null)};if(l!=null)return i=i(),l.current=i,function(){l.current=null}}function x0(i,l,h){return h=h!=null?h.concat([i]):null,Tl(4,4,g0.bind(null,l,i),h)}function Md(){}function y0(i,l){var h=Cn();l=l===void 0?null:l;var g=h.memoizedState;return g!==null&&l!==null&&Td(l,g[1])?g[0]:(h.memoizedState=[i,l],i)}function k0(i,l){var h=Cn();l=l===void 0?null:l;var g=h.memoizedState;return g!==null&&l!==null&&Td(l,g[1])?g[0]:(i=i(),h.memoizedState=[i,l],i)}function v0(i,l,h){return(jr&21)===0?(i.baseState&&(i.baseState=!1,Qt=!0),i.memoizedState=h):(Ln(h,l)||(h=Gm(),it.lanes|=h,br|=h,i.baseState=!0),l)}function l3(i,l){var h=Ke;Ke=h!==0&&4>h?h:4,i(!0);var g=Ed.transition;Ed.transition={};try{i(!1),l()}finally{Ke=h,Ed.transition=g}}function j0(){return Cn().memoizedState}function c3(i,l,h){var g=Zs(i);if(h={lane:g,action:h,hasEagerState:!1,eagerState:null,next:null},b0(i))w0(l,h);else if(h=J1(i,l,h,g),h!==null){var j=Bt();Bn(h,i,g,j),N0(h,l,g)}}function u3(i,l,h){var g=Zs(i),j={lane:g,action:h,hasEagerState:!1,eagerState:null,next:null};if(b0(i))w0(l,j);else{var w=i.alternate;if(i.lanes===0&&(w===null||w.lanes===0)&&(w=l.lastRenderedReducer,w!==null))try{var E=l.lastRenderedState,L=w(E,h);if(j.hasEagerState=!0,j.eagerState=L,Ln(L,E)){var W=l.interleaved;W===null?(j.next=j,bd(l)):(j.next=W.next,W.next=j),l.interleaved=j;return}}catch{}finally{}h=J1(i,l,j,g),h!==null&&(j=Bt(),Bn(h,i,g,j),N0(h,l,g))}}function b0(i){var l=i.alternate;return i===it||l!==null&&l===it}function w0(i,l){Sa=$l=!0;var h=i.pending;h===null?l.next=l:(l.next=h.next,h.next=l),i.pending=l}function N0(i,l,h){if((h&4194240)!==0){var g=l.lanes;g&=i.pendingLanes,h|=g,l.lanes=h,Lu(i,h)}}var Al={readContext:Sn,useCallback:Rt,useContext:Rt,useEffect:Rt,useImperativeHandle:Rt,useInsertionEffect:Rt,useLayoutEffect:Rt,useMemo:Rt,useReducer:Rt,useRef:Rt,useState:Rt,useDebugValue:Rt,useDeferredValue:Rt,useTransition:Rt,useMutableSource:Rt,useSyncExternalStore:Rt,useId:Rt,unstable_isNewReconciler:!1},d3={readContext:Sn,useCallback:function(i,l){return es().memoizedState=[i,l===void 0?null:l],i},useContext:Sn,useEffect:p0,useImperativeHandle:function(i,l,h){return h=h!=null?h.concat([i]):null,El(4194308,4,g0.bind(null,l,i),h)},useLayoutEffect:function(i,l){return El(4194308,4,i,l)},useInsertionEffect:function(i,l){return El(4,2,i,l)},useMemo:function(i,l){var h=es();return l=l===void 0?null:l,i=i(),h.memoizedState=[i,l],i},useReducer:function(i,l,h){var g=es();return l=h!==void 0?h(l):l,g.memoizedState=g.baseState=l,i={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:l},g.queue=i,i=i.dispatch=c3.bind(null,it,i),[g.memoizedState,i]},useRef:function(i){var l=es();return i={current:i},l.memoizedState=i},useState:d0,useDebugValue:Md,useDeferredValue:function(i){return es().memoizedState=i},useTransition:function(){var i=d0(!1),l=i[0];return i=l3.bind(null,i[1]),es().memoizedState=i,[l,i]},useMutableSource:function(){},useSyncExternalStore:function(i,l,h){var g=it,j=es();if(tt){if(h===void 0)throw Error(s(407));h=h()}else{if(h=l(),vt===null)throw Error(s(349));(jr&30)!==0||a0(g,l,h)}j.memoizedState=h;var w={value:h,getSnapshot:l};return j.queue=w,p0(l0.bind(null,g,w,i),[i]),g.flags|=2048,Ea(9,o0.bind(null,g,w,h,l),void 0,null),h},useId:function(){var i=es(),l=vt.identifierPrefix;if(tt){var h=xs,g=gs;h=(g&~(1<<32-Fn(g)-1)).toString(32)+h,l=":"+l+"R"+h,h=Ca++,0<h&&(l+="H"+h.toString(32)),l+=":"}else h=o3++,l=":"+l+"r"+h.toString(32)+":";return i.memoizedState=l},unstable_isNewReconciler:!1},h3={readContext:Sn,useCallback:y0,useContext:Sn,useEffect:zd,useImperativeHandle:x0,useInsertionEffect:f0,useLayoutEffect:m0,useMemo:k0,useReducer:Rd,useRef:h0,useState:function(){return Rd($a)},useDebugValue:Md,useDeferredValue:function(i){var l=Cn();return v0(l,ft.memoizedState,i)},useTransition:function(){var i=Rd($a)[0],l=Cn().memoizedState;return[i,l]},useMutableSource:r0,useSyncExternalStore:i0,useId:j0,unstable_isNewReconciler:!1},p3={readContext:Sn,useCallback:y0,useContext:Sn,useEffect:zd,useImperativeHandle:x0,useInsertionEffect:f0,useLayoutEffect:m0,useMemo:k0,useReducer:Id,useRef:h0,useState:function(){return Id($a)},useDebugValue:Md,useDeferredValue:function(i){var l=Cn();return ft===null?l.memoizedState=i:v0(l,ft.memoizedState,i)},useTransition:function(){var i=Id($a)[0],l=Cn().memoizedState;return[i,l]},useMutableSource:r0,useSyncExternalStore:i0,useId:j0,unstable_isNewReconciler:!1};function On(i,l){if(i&&i.defaultProps){l=A({},l),i=i.defaultProps;for(var h in i)l[h]===void 0&&(l[h]=i[h]);return l}return l}function Fd(i,l,h,g){l=i.memoizedState,h=h(g,l),h=h==null?l:A({},l,h),i.memoizedState=h,i.lanes===0&&(i.updateQueue.baseState=h)}var Pl={isMounted:function(i){return(i=i._reactInternals)?fr(i)===i:!1},enqueueSetState:function(i,l,h){i=i._reactInternals;var g=Bt(),j=Zs(i),w=ks(g,j);w.payload=l,h!=null&&(w.callback=h),l=Ks(i,w,j),l!==null&&(Bn(l,i,j,g),wl(l,i,j))},enqueueReplaceState:function(i,l,h){i=i._reactInternals;var g=Bt(),j=Zs(i),w=ks(g,j);w.tag=1,w.payload=l,h!=null&&(w.callback=h),l=Ks(i,w,j),l!==null&&(Bn(l,i,j,g),wl(l,i,j))},enqueueForceUpdate:function(i,l){i=i._reactInternals;var h=Bt(),g=Zs(i),j=ks(h,g);j.tag=2,l!=null&&(j.callback=l),l=Ks(i,j,g),l!==null&&(Bn(l,i,g,h),wl(l,i,g))}};function S0(i,l,h,g,j,w,E){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(g,w,E):l.prototype&&l.prototype.isPureReactComponent?!fa(h,g)||!fa(j,w):!0}function C0(i,l,h){var g=!1,j=Us,w=l.contextType;return typeof w=="object"&&w!==null?w=Sn(w):(j=Yt(l)?gr:Pt.current,g=l.contextTypes,w=(g=g!=null)?ci(i,j):Us),l=new l(h,w),i.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,l.updater=Pl,i.stateNode=l,l._reactInternals=i,g&&(i=i.stateNode,i.__reactInternalMemoizedUnmaskedChildContext=j,i.__reactInternalMemoizedMaskedChildContext=w),l}function $0(i,l,h,g){i=l.state,typeof l.componentWillReceiveProps=="function"&&l.componentWillReceiveProps(h,g),typeof l.UNSAFE_componentWillReceiveProps=="function"&&l.UNSAFE_componentWillReceiveProps(h,g),l.state!==i&&Pl.enqueueReplaceState(l,l.state,null)}function Ld(i,l,h,g){var j=i.stateNode;j.props=h,j.state=i.memoizedState,j.refs={},wd(i);var w=l.contextType;typeof w=="object"&&w!==null?j.context=Sn(w):(w=Yt(l)?gr:Pt.current,j.context=ci(i,w)),j.state=i.memoizedState,w=l.getDerivedStateFromProps,typeof w=="function"&&(Fd(i,l,w,h),j.state=i.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof j.getSnapshotBeforeUpdate=="function"||typeof j.UNSAFE_componentWillMount!="function"&&typeof j.componentWillMount!="function"||(l=j.state,typeof j.componentWillMount=="function"&&j.componentWillMount(),typeof j.UNSAFE_componentWillMount=="function"&&j.UNSAFE_componentWillMount(),l!==j.state&&Pl.enqueueReplaceState(j,j.state,null),Nl(i,h,j,g),j.state=i.memoizedState),typeof j.componentDidMount=="function"&&(i.flags|=4194308)}function xi(i,l){try{var h="",g=l;do h+=he(g),g=g.return;while(g);var j=h}catch(w){j=`
39
- Error generating stack: `+w.message+`
40
- `+w.stack}return{value:i,source:l,stack:j,digest:null}}function _d(i,l,h){return{value:i,source:null,stack:h??null,digest:l??null}}function Od(i,l){try{console.error(l.value)}catch(h){setTimeout(function(){throw h})}}var f3=typeof WeakMap=="function"?WeakMap:Map;function E0(i,l,h){h=ks(-1,h),h.tag=3,h.payload={element:null};var g=l.value;return h.callback=function(){_l||(_l=!0,eh=g),Od(i,l)},h}function T0(i,l,h){h=ks(-1,h),h.tag=3;var g=i.type.getDerivedStateFromError;if(typeof g=="function"){var j=l.value;h.payload=function(){return g(j)},h.callback=function(){Od(i,l)}}var w=i.stateNode;return w!==null&&typeof w.componentDidCatch=="function"&&(h.callback=function(){Od(i,l),typeof g!="function"&&(Qs===null?Qs=new Set([this]):Qs.add(this));var E=l.stack;this.componentDidCatch(l.value,{componentStack:E!==null?E:""})}),h}function A0(i,l,h){var g=i.pingCache;if(g===null){g=i.pingCache=new f3;var j=new Set;g.set(l,j)}else j=g.get(l),j===void 0&&(j=new Set,g.set(l,j));j.has(h)||(j.add(h),i=E3.bind(null,i,l,h),l.then(i,i))}function P0(i){do{var l;if((l=i.tag===13)&&(l=i.memoizedState,l=l!==null?l.dehydrated!==null:!0),l)return i;i=i.return}while(i!==null);return null}function R0(i,l,h,g,j){return(i.mode&1)===0?(i===l?i.flags|=65536:(i.flags|=128,h.flags|=131072,h.flags&=-52805,h.tag===1&&(h.alternate===null?h.tag=17:(l=ks(-1,1),l.tag=2,Ks(h,l,1))),h.lanes|=1),i):(i.flags|=65536,i.lanes=j,i)}var m3=P.ReactCurrentOwner,Qt=!1;function Dt(i,l,h,g){l.child=i===null?X1(l,null,h,g):pi(l,i.child,h,g)}function I0(i,l,h,g,j){h=h.render;var w=l.ref;return mi(l,j),g=Ad(i,l,h,g,w,j),h=Pd(),i!==null&&!Qt?(l.updateQueue=i.updateQueue,l.flags&=-2053,i.lanes&=~j,vs(i,l,j)):(tt&&h&&pd(l),l.flags|=1,Dt(i,l,g,j),l.child)}function z0(i,l,h,g,j){if(i===null){var w=h.type;return typeof w=="function"&&!oh(w)&&w.defaultProps===void 0&&h.compare===null&&h.defaultProps===void 0?(l.tag=15,l.type=w,M0(i,l,w,g,j)):(i=Ul(h.type,null,g,l,l.mode,j),i.ref=l.ref,i.return=l,l.child=i)}if(w=i.child,(i.lanes&j)===0){var E=w.memoizedProps;if(h=h.compare,h=h!==null?h:fa,h(E,g)&&i.ref===l.ref)return vs(i,l,j)}return l.flags|=1,i=Js(w,g),i.ref=l.ref,i.return=l,l.child=i}function M0(i,l,h,g,j){if(i!==null){var w=i.memoizedProps;if(fa(w,g)&&i.ref===l.ref)if(Qt=!1,l.pendingProps=g=w,(i.lanes&j)!==0)(i.flags&131072)!==0&&(Qt=!0);else return l.lanes=i.lanes,vs(i,l,j)}return qd(i,l,h,g,j)}function F0(i,l,h){var g=l.pendingProps,j=g.children,w=i!==null?i.memoizedState:null;if(g.mode==="hidden")if((l.mode&1)===0)l.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ge(ki,fn),fn|=h;else{if((h&1073741824)===0)return i=w!==null?w.baseLanes|h:h,l.lanes=l.childLanes=1073741824,l.memoizedState={baseLanes:i,cachePool:null,transitions:null},l.updateQueue=null,Ge(ki,fn),fn|=i,null;l.memoizedState={baseLanes:0,cachePool:null,transitions:null},g=w!==null?w.baseLanes:h,Ge(ki,fn),fn|=g}else w!==null?(g=w.baseLanes|h,l.memoizedState=null):g=h,Ge(ki,fn),fn|=g;return Dt(i,l,j,h),l.child}function L0(i,l){var h=l.ref;(i===null&&h!==null||i!==null&&i.ref!==h)&&(l.flags|=512,l.flags|=2097152)}function qd(i,l,h,g,j){var w=Yt(h)?gr:Pt.current;return w=ci(l,w),mi(l,j),h=Ad(i,l,h,g,w,j),g=Pd(),i!==null&&!Qt?(l.updateQueue=i.updateQueue,l.flags&=-2053,i.lanes&=~j,vs(i,l,j)):(tt&&g&&pd(l),l.flags|=1,Dt(i,l,h,j),l.child)}function _0(i,l,h,g,j){if(Yt(h)){var w=!0;ml(l)}else w=!1;if(mi(l,j),l.stateNode===null)Il(i,l),C0(l,h,g),Ld(l,h,g,j),g=!0;else if(i===null){var E=l.stateNode,L=l.memoizedProps;E.props=L;var W=E.context,Z=h.contextType;typeof Z=="object"&&Z!==null?Z=Sn(Z):(Z=Yt(h)?gr:Pt.current,Z=ci(l,Z));var ie=h.getDerivedStateFromProps,oe=typeof ie=="function"||typeof E.getSnapshotBeforeUpdate=="function";oe||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||(L!==g||W!==Z)&&$0(l,E,g,Z),Vs=!1;var re=l.memoizedState;E.state=re,Nl(l,g,E,j),W=l.memoizedState,L!==g||re!==W||Kt.current||Vs?(typeof ie=="function"&&(Fd(l,h,ie,g),W=l.memoizedState),(L=Vs||S0(l,h,L,g,re,W,Z))?(oe||typeof E.UNSAFE_componentWillMount!="function"&&typeof E.componentWillMount!="function"||(typeof E.componentWillMount=="function"&&E.componentWillMount(),typeof E.UNSAFE_componentWillMount=="function"&&E.UNSAFE_componentWillMount()),typeof E.componentDidMount=="function"&&(l.flags|=4194308)):(typeof E.componentDidMount=="function"&&(l.flags|=4194308),l.memoizedProps=g,l.memoizedState=W),E.props=g,E.state=W,E.context=Z,g=L):(typeof E.componentDidMount=="function"&&(l.flags|=4194308),g=!1)}else{E=l.stateNode,e0(i,l),L=l.memoizedProps,Z=l.type===l.elementType?L:On(l.type,L),E.props=Z,oe=l.pendingProps,re=E.context,W=h.contextType,typeof W=="object"&&W!==null?W=Sn(W):(W=Yt(h)?gr:Pt.current,W=ci(l,W));var fe=h.getDerivedStateFromProps;(ie=typeof fe=="function"||typeof E.getSnapshotBeforeUpdate=="function")||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||(L!==oe||re!==W)&&$0(l,E,g,W),Vs=!1,re=l.memoizedState,E.state=re,Nl(l,g,E,j);var ye=l.memoizedState;L!==oe||re!==ye||Kt.current||Vs?(typeof fe=="function"&&(Fd(l,h,fe,g),ye=l.memoizedState),(Z=Vs||S0(l,h,Z,g,re,ye,W)||!1)?(ie||typeof E.UNSAFE_componentWillUpdate!="function"&&typeof E.componentWillUpdate!="function"||(typeof E.componentWillUpdate=="function"&&E.componentWillUpdate(g,ye,W),typeof E.UNSAFE_componentWillUpdate=="function"&&E.UNSAFE_componentWillUpdate(g,ye,W)),typeof E.componentDidUpdate=="function"&&(l.flags|=4),typeof E.getSnapshotBeforeUpdate=="function"&&(l.flags|=1024)):(typeof E.componentDidUpdate!="function"||L===i.memoizedProps&&re===i.memoizedState||(l.flags|=4),typeof E.getSnapshotBeforeUpdate!="function"||L===i.memoizedProps&&re===i.memoizedState||(l.flags|=1024),l.memoizedProps=g,l.memoizedState=ye),E.props=g,E.state=ye,E.context=W,g=Z):(typeof E.componentDidUpdate!="function"||L===i.memoizedProps&&re===i.memoizedState||(l.flags|=4),typeof E.getSnapshotBeforeUpdate!="function"||L===i.memoizedProps&&re===i.memoizedState||(l.flags|=1024),g=!1)}return Dd(i,l,h,g,w,j)}function Dd(i,l,h,g,j,w){L0(i,l);var E=(l.flags&128)!==0;if(!g&&!E)return j&&W1(l,h,!1),vs(i,l,w);g=l.stateNode,m3.current=l;var L=E&&typeof h.getDerivedStateFromError!="function"?null:g.render();return l.flags|=1,i!==null&&E?(l.child=pi(l,i.child,null,w),l.child=pi(l,null,L,w)):Dt(i,l,L,w),l.memoizedState=g.state,j&&W1(l,h,!0),l.child}function O0(i){var l=i.stateNode;l.pendingContext?D1(i,l.pendingContext,l.pendingContext!==l.context):l.context&&D1(i,l.context,!1),Nd(i,l.containerInfo)}function q0(i,l,h,g,j){return hi(),xd(j),l.flags|=256,Dt(i,l,h,g),l.child}var Bd={dehydrated:null,treeContext:null,retryLane:0};function Wd(i){return{baseLanes:i,cachePool:null,transitions:null}}function D0(i,l,h){var g=l.pendingProps,j=rt.current,w=!1,E=(l.flags&128)!==0,L;if((L=E)||(L=i!==null&&i.memoizedState===null?!1:(j&2)!==0),L?(w=!0,l.flags&=-129):(i===null||i.memoizedState!==null)&&(j|=1),Ge(rt,j&1),i===null)return gd(l),i=l.memoizedState,i!==null&&(i=i.dehydrated,i!==null)?((l.mode&1)===0?l.lanes=1:i.data==="$!"?l.lanes=8:l.lanes=1073741824,null):(E=g.children,i=g.fallback,w?(g=l.mode,w=l.child,E={mode:"hidden",children:E},(g&1)===0&&w!==null?(w.childLanes=0,w.pendingProps=E):w=Hl(E,g,0,null),i=Cr(i,g,h,null),w.return=l,i.return=l,w.sibling=i,l.child=w,l.child.memoizedState=Wd(h),l.memoizedState=Bd,i):Ud(l,E));if(j=i.memoizedState,j!==null&&(L=j.dehydrated,L!==null))return g3(i,l,E,g,L,j,h);if(w){w=g.fallback,E=l.mode,j=i.child,L=j.sibling;var W={mode:"hidden",children:g.children};return(E&1)===0&&l.child!==j?(g=l.child,g.childLanes=0,g.pendingProps=W,l.deletions=null):(g=Js(j,W),g.subtreeFlags=j.subtreeFlags&14680064),L!==null?w=Js(L,w):(w=Cr(w,E,h,null),w.flags|=2),w.return=l,g.return=l,g.sibling=w,l.child=g,g=w,w=l.child,E=i.child.memoizedState,E=E===null?Wd(h):{baseLanes:E.baseLanes|h,cachePool:null,transitions:E.transitions},w.memoizedState=E,w.childLanes=i.childLanes&~h,l.memoizedState=Bd,g}return w=i.child,i=w.sibling,g=Js(w,{mode:"visible",children:g.children}),(l.mode&1)===0&&(g.lanes=h),g.return=l,g.sibling=null,i!==null&&(h=l.deletions,h===null?(l.deletions=[i],l.flags|=16):h.push(i)),l.child=g,l.memoizedState=null,g}function Ud(i,l){return l=Hl({mode:"visible",children:l},i.mode,0,null),l.return=i,i.child=l}function Rl(i,l,h,g){return g!==null&&xd(g),pi(l,i.child,null,h),i=Ud(l,l.pendingProps.children),i.flags|=2,l.memoizedState=null,i}function g3(i,l,h,g,j,w,E){if(h)return l.flags&256?(l.flags&=-257,g=_d(Error(s(422))),Rl(i,l,E,g)):l.memoizedState!==null?(l.child=i.child,l.flags|=128,null):(w=g.fallback,j=l.mode,g=Hl({mode:"visible",children:g.children},j,0,null),w=Cr(w,j,E,null),w.flags|=2,g.return=l,w.return=l,g.sibling=w,l.child=g,(l.mode&1)!==0&&pi(l,i.child,null,E),l.child.memoizedState=Wd(E),l.memoizedState=Bd,w);if((l.mode&1)===0)return Rl(i,l,E,null);if(j.data==="$!"){if(g=j.nextSibling&&j.nextSibling.dataset,g)var L=g.dgst;return g=L,w=Error(s(419)),g=_d(w,g,void 0),Rl(i,l,E,g)}if(L=(E&i.childLanes)!==0,Qt||L){if(g=vt,g!==null){switch(E&-E){case 4:j=2;break;case 16:j=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:j=32;break;case 536870912:j=268435456;break;default:j=0}j=(j&(g.suspendedLanes|E))!==0?0:j,j!==0&&j!==w.retryLane&&(w.retryLane=j,ys(i,j),Bn(g,i,j,-1))}return ah(),g=_d(Error(s(421))),Rl(i,l,E,g)}return j.data==="$?"?(l.flags|=128,l.child=i.child,l=T3.bind(null,i),j._reactRetry=l,null):(i=w.treeContext,pn=Bs(j.nextSibling),hn=l,tt=!0,_n=null,i!==null&&(wn[Nn++]=gs,wn[Nn++]=xs,wn[Nn++]=xr,gs=i.id,xs=i.overflow,xr=l),l=Ud(l,g.children),l.flags|=4096,l)}function B0(i,l,h){i.lanes|=l;var g=i.alternate;g!==null&&(g.lanes|=l),jd(i.return,l,h)}function Hd(i,l,h,g,j){var w=i.memoizedState;w===null?i.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:g,tail:h,tailMode:j}:(w.isBackwards=l,w.rendering=null,w.renderingStartTime=0,w.last=g,w.tail=h,w.tailMode=j)}function W0(i,l,h){var g=l.pendingProps,j=g.revealOrder,w=g.tail;if(Dt(i,l,g.children,h),g=rt.current,(g&2)!==0)g=g&1|2,l.flags|=128;else{if(i!==null&&(i.flags&128)!==0)e:for(i=l.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&B0(i,h,l);else if(i.tag===19)B0(i,h,l);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===l)break e;for(;i.sibling===null;){if(i.return===null||i.return===l)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}g&=1}if(Ge(rt,g),(l.mode&1)===0)l.memoizedState=null;else switch(j){case"forwards":for(h=l.child,j=null;h!==null;)i=h.alternate,i!==null&&Sl(i)===null&&(j=h),h=h.sibling;h=j,h===null?(j=l.child,l.child=null):(j=h.sibling,h.sibling=null),Hd(l,!1,j,h,w);break;case"backwards":for(h=null,j=l.child,l.child=null;j!==null;){if(i=j.alternate,i!==null&&Sl(i)===null){l.child=j;break}i=j.sibling,j.sibling=h,h=j,j=i}Hd(l,!0,h,null,w);break;case"together":Hd(l,!1,null,null,void 0);break;default:l.memoizedState=null}return l.child}function Il(i,l){(l.mode&1)===0&&i!==null&&(i.alternate=null,l.alternate=null,l.flags|=2)}function vs(i,l,h){if(i!==null&&(l.dependencies=i.dependencies),br|=l.lanes,(h&l.childLanes)===0)return null;if(i!==null&&l.child!==i.child)throw Error(s(153));if(l.child!==null){for(i=l.child,h=Js(i,i.pendingProps),l.child=h,h.return=l;i.sibling!==null;)i=i.sibling,h=h.sibling=Js(i,i.pendingProps),h.return=l;h.sibling=null}return l.child}function x3(i,l,h){switch(l.tag){case 3:O0(l),hi();break;case 5:s0(l);break;case 1:Yt(l.type)&&ml(l);break;case 4:Nd(l,l.stateNode.containerInfo);break;case 10:var g=l.type._context,j=l.memoizedProps.value;Ge(jl,g._currentValue),g._currentValue=j;break;case 13:if(g=l.memoizedState,g!==null)return g.dehydrated!==null?(Ge(rt,rt.current&1),l.flags|=128,null):(h&l.child.childLanes)!==0?D0(i,l,h):(Ge(rt,rt.current&1),i=vs(i,l,h),i!==null?i.sibling:null);Ge(rt,rt.current&1);break;case 19:if(g=(h&l.childLanes)!==0,(i.flags&128)!==0){if(g)return W0(i,l,h);l.flags|=128}if(j=l.memoizedState,j!==null&&(j.rendering=null,j.tail=null,j.lastEffect=null),Ge(rt,rt.current),g)break;return null;case 22:case 23:return l.lanes=0,F0(i,l,h)}return vs(i,l,h)}var U0,Vd,H0,V0;U0=function(i,l){for(var h=l.child;h!==null;){if(h.tag===5||h.tag===6)i.appendChild(h.stateNode);else if(h.tag!==4&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===l)break;for(;h.sibling===null;){if(h.return===null||h.return===l)return;h=h.return}h.sibling.return=h.return,h=h.sibling}},Vd=function(){},H0=function(i,l,h,g){var j=i.memoizedProps;if(j!==g){i=l.stateNode,vr(Jn.current);var w=null;switch(h){case"input":j=Kn(i,j),g=Kn(i,g),w=[];break;case"select":j=A({},j,{value:void 0}),g=A({},g,{value:void 0}),w=[];break;case"textarea":j=Yn(i,j),g=Yn(i,g),w=[];break;default:typeof j.onClick!="function"&&typeof g.onClick=="function"&&(i.onclick=hl)}St(h,g);var E;h=null;for(Z in j)if(!g.hasOwnProperty(Z)&&j.hasOwnProperty(Z)&&j[Z]!=null)if(Z==="style"){var L=j[Z];for(E in L)L.hasOwnProperty(E)&&(h||(h={}),h[E]="")}else Z!=="dangerouslySetInnerHTML"&&Z!=="children"&&Z!=="suppressContentEditableWarning"&&Z!=="suppressHydrationWarning"&&Z!=="autoFocus"&&(a.hasOwnProperty(Z)?w||(w=[]):(w=w||[]).push(Z,null));for(Z in g){var W=g[Z];if(L=j?.[Z],g.hasOwnProperty(Z)&&W!==L&&(W!=null||L!=null))if(Z==="style")if(L){for(E in L)!L.hasOwnProperty(E)||W&&W.hasOwnProperty(E)||(h||(h={}),h[E]="");for(E in W)W.hasOwnProperty(E)&&L[E]!==W[E]&&(h||(h={}),h[E]=W[E])}else h||(w||(w=[]),w.push(Z,h)),h=W;else Z==="dangerouslySetInnerHTML"?(W=W?W.__html:void 0,L=L?L.__html:void 0,W!=null&&L!==W&&(w=w||[]).push(Z,W)):Z==="children"?typeof W!="string"&&typeof W!="number"||(w=w||[]).push(Z,""+W):Z!=="suppressContentEditableWarning"&&Z!=="suppressHydrationWarning"&&(a.hasOwnProperty(Z)?(W!=null&&Z==="onScroll"&&Je("scroll",i),w||L===W||(w=[])):(w=w||[]).push(Z,W))}h&&(w=w||[]).push("style",h);var Z=w;(l.updateQueue=Z)&&(l.flags|=4)}},V0=function(i,l,h,g){h!==g&&(l.flags|=4)};function Ta(i,l){if(!tt)switch(i.tailMode){case"hidden":l=i.tail;for(var h=null;l!==null;)l.alternate!==null&&(h=l),l=l.sibling;h===null?i.tail=null:h.sibling=null;break;case"collapsed":h=i.tail;for(var g=null;h!==null;)h.alternate!==null&&(g=h),h=h.sibling;g===null?l||i.tail===null?i.tail=null:i.tail.sibling=null:g.sibling=null}}function It(i){var l=i.alternate!==null&&i.alternate.child===i.child,h=0,g=0;if(l)for(var j=i.child;j!==null;)h|=j.lanes|j.childLanes,g|=j.subtreeFlags&14680064,g|=j.flags&14680064,j.return=i,j=j.sibling;else for(j=i.child;j!==null;)h|=j.lanes|j.childLanes,g|=j.subtreeFlags,g|=j.flags,j.return=i,j=j.sibling;return i.subtreeFlags|=g,i.childLanes=h,l}function y3(i,l,h){var g=l.pendingProps;switch(fd(l),l.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return It(l),null;case 1:return Yt(l.type)&&fl(),It(l),null;case 3:return g=l.stateNode,gi(),et(Kt),et(Pt),$d(),g.pendingContext&&(g.context=g.pendingContext,g.pendingContext=null),(i===null||i.child===null)&&(kl(l)?l.flags|=4:i===null||i.memoizedState.isDehydrated&&(l.flags&256)===0||(l.flags|=1024,_n!==null&&(sh(_n),_n=null))),Vd(i,l),It(l),null;case 5:Sd(l);var j=vr(Na.current);if(h=l.type,i!==null&&l.stateNode!=null)H0(i,l,h,g,j),i.ref!==l.ref&&(l.flags|=512,l.flags|=2097152);else{if(!g){if(l.stateNode===null)throw Error(s(166));return It(l),null}if(i=vr(Jn.current),kl(l)){g=l.stateNode,h=l.type;var w=l.memoizedProps;switch(g[Xn]=l,g[ka]=w,i=(l.mode&1)!==0,h){case"dialog":Je("cancel",g),Je("close",g);break;case"iframe":case"object":case"embed":Je("load",g);break;case"video":case"audio":for(j=0;j<ga.length;j++)Je(ga[j],g);break;case"source":Je("error",g);break;case"img":case"image":case"link":Je("error",g),Je("load",g);break;case"details":Je("toggle",g);break;case"input":Ht(g,w),Je("invalid",g);break;case"select":g._wrapperState={wasMultiple:!!w.multiple},Je("invalid",g);break;case"textarea":Ms(g,w),Je("invalid",g)}St(h,w),j=null;for(var E in w)if(w.hasOwnProperty(E)){var L=w[E];E==="children"?typeof L=="string"?g.textContent!==L&&(w.suppressHydrationWarning!==!0&&dl(g.textContent,L,i),j=["children",L]):typeof L=="number"&&g.textContent!==""+L&&(w.suppressHydrationWarning!==!0&&dl(g.textContent,L,i),j=["children",""+L]):a.hasOwnProperty(E)&&L!=null&&E==="onScroll"&&Je("scroll",g)}switch(h){case"input":ct(g),ln(g,w,!0);break;case"textarea":ct(g),He(g);break;case"select":case"option":break;default:typeof w.onClick=="function"&&(g.onclick=hl)}g=j,l.updateQueue=g,g!==null&&(l.flags|=4)}else{E=j.nodeType===9?j:j.ownerDocument,i==="http://www.w3.org/1999/xhtml"&&(i=X(h)),i==="http://www.w3.org/1999/xhtml"?h==="script"?(i=E.createElement("div"),i.innerHTML="<script><\/script>",i=i.removeChild(i.firstChild)):typeof g.is=="string"?i=E.createElement(h,{is:g.is}):(i=E.createElement(h),h==="select"&&(E=i,g.multiple?E.multiple=!0:g.size&&(E.size=g.size))):i=E.createElementNS(i,h),i[Xn]=l,i[ka]=g,U0(i,l,!1,!1),l.stateNode=i;e:{switch(E=Gn(h,g),h){case"dialog":Je("cancel",i),Je("close",i),j=g;break;case"iframe":case"object":case"embed":Je("load",i),j=g;break;case"video":case"audio":for(j=0;j<ga.length;j++)Je(ga[j],i);j=g;break;case"source":Je("error",i),j=g;break;case"img":case"image":case"link":Je("error",i),Je("load",i),j=g;break;case"details":Je("toggle",i),j=g;break;case"input":Ht(i,g),j=Kn(i,g),Je("invalid",i);break;case"option":j=g;break;case"select":i._wrapperState={wasMultiple:!!g.multiple},j=A({},g,{value:void 0}),Je("invalid",i);break;case"textarea":Ms(i,g),j=Yn(i,g),Je("invalid",i);break;default:j=g}St(h,j),L=j;for(w in L)if(L.hasOwnProperty(w)){var W=L[w];w==="style"?yt(i,W):w==="dangerouslySetInnerHTML"?(W=W?W.__html:void 0,W!=null&&Me(i,W)):w==="children"?typeof W=="string"?(h!=="textarea"||W!=="")&&J(i,W):typeof W=="number"&&J(i,""+W):w!=="suppressContentEditableWarning"&&w!=="suppressHydrationWarning"&&w!=="autoFocus"&&(a.hasOwnProperty(w)?W!=null&&w==="onScroll"&&Je("scroll",i):W!=null&&S(i,w,W,E))}switch(h){case"input":ct(i),ln(i,g,!1);break;case"textarea":ct(i),He(i);break;case"option":g.value!=null&&i.setAttribute("value",""+Ae(g.value));break;case"select":i.multiple=!!g.multiple,w=g.value,w!=null?cn(i,!!g.multiple,w,!1):g.defaultValue!=null&&cn(i,!!g.multiple,g.defaultValue,!0);break;default:typeof j.onClick=="function"&&(i.onclick=hl)}switch(h){case"button":case"input":case"select":case"textarea":g=!!g.autoFocus;break e;case"img":g=!0;break e;default:g=!1}}g&&(l.flags|=4)}l.ref!==null&&(l.flags|=512,l.flags|=2097152)}return It(l),null;case 6:if(i&&l.stateNode!=null)V0(i,l,i.memoizedProps,g);else{if(typeof g!="string"&&l.stateNode===null)throw Error(s(166));if(h=vr(Na.current),vr(Jn.current),kl(l)){if(g=l.stateNode,h=l.memoizedProps,g[Xn]=l,(w=g.nodeValue!==h)&&(i=hn,i!==null))switch(i.tag){case 3:dl(g.nodeValue,h,(i.mode&1)!==0);break;case 5:i.memoizedProps.suppressHydrationWarning!==!0&&dl(g.nodeValue,h,(i.mode&1)!==0)}w&&(l.flags|=4)}else g=(h.nodeType===9?h:h.ownerDocument).createTextNode(g),g[Xn]=l,l.stateNode=g}return It(l),null;case 13:if(et(rt),g=l.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(tt&&pn!==null&&(l.mode&1)!==0&&(l.flags&128)===0)Q1(),hi(),l.flags|=98560,w=!1;else if(w=kl(l),g!==null&&g.dehydrated!==null){if(i===null){if(!w)throw Error(s(318));if(w=l.memoizedState,w=w!==null?w.dehydrated:null,!w)throw Error(s(317));w[Xn]=l}else hi(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;It(l),w=!1}else _n!==null&&(sh(_n),_n=null),w=!0;if(!w)return l.flags&65536?l:null}return(l.flags&128)!==0?(l.lanes=h,l):(g=g!==null,g!==(i!==null&&i.memoizedState!==null)&&g&&(l.child.flags|=8192,(l.mode&1)!==0&&(i===null||(rt.current&1)!==0?mt===0&&(mt=3):ah())),l.updateQueue!==null&&(l.flags|=4),It(l),null);case 4:return gi(),Vd(i,l),i===null&&xa(l.stateNode.containerInfo),It(l),null;case 10:return vd(l.type._context),It(l),null;case 17:return Yt(l.type)&&fl(),It(l),null;case 19:if(et(rt),w=l.memoizedState,w===null)return It(l),null;if(g=(l.flags&128)!==0,E=w.rendering,E===null)if(g)Ta(w,!1);else{if(mt!==0||i!==null&&(i.flags&128)!==0)for(i=l.child;i!==null;){if(E=Sl(i),E!==null){for(l.flags|=128,Ta(w,!1),g=E.updateQueue,g!==null&&(l.updateQueue=g,l.flags|=4),l.subtreeFlags=0,g=h,h=l.child;h!==null;)w=h,i=g,w.flags&=14680066,E=w.alternate,E===null?(w.childLanes=0,w.lanes=i,w.child=null,w.subtreeFlags=0,w.memoizedProps=null,w.memoizedState=null,w.updateQueue=null,w.dependencies=null,w.stateNode=null):(w.childLanes=E.childLanes,w.lanes=E.lanes,w.child=E.child,w.subtreeFlags=0,w.deletions=null,w.memoizedProps=E.memoizedProps,w.memoizedState=E.memoizedState,w.updateQueue=E.updateQueue,w.type=E.type,i=E.dependencies,w.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),h=h.sibling;return Ge(rt,rt.current&1|2),l.child}i=i.sibling}w.tail!==null&&ut()>vi&&(l.flags|=128,g=!0,Ta(w,!1),l.lanes=4194304)}else{if(!g)if(i=Sl(E),i!==null){if(l.flags|=128,g=!0,h=i.updateQueue,h!==null&&(l.updateQueue=h,l.flags|=4),Ta(w,!0),w.tail===null&&w.tailMode==="hidden"&&!E.alternate&&!tt)return It(l),null}else 2*ut()-w.renderingStartTime>vi&&h!==1073741824&&(l.flags|=128,g=!0,Ta(w,!1),l.lanes=4194304);w.isBackwards?(E.sibling=l.child,l.child=E):(h=w.last,h!==null?h.sibling=E:l.child=E,w.last=E)}return w.tail!==null?(l=w.tail,w.rendering=l,w.tail=l.sibling,w.renderingStartTime=ut(),l.sibling=null,h=rt.current,Ge(rt,g?h&1|2:h&1),l):(It(l),null);case 22:case 23:return ih(),g=l.memoizedState!==null,i!==null&&i.memoizedState!==null!==g&&(l.flags|=8192),g&&(l.mode&1)!==0?(fn&1073741824)!==0&&(It(l),l.subtreeFlags&6&&(l.flags|=8192)):It(l),null;case 24:return null;case 25:return null}throw Error(s(156,l.tag))}function k3(i,l){switch(fd(l),l.tag){case 1:return Yt(l.type)&&fl(),i=l.flags,i&65536?(l.flags=i&-65537|128,l):null;case 3:return gi(),et(Kt),et(Pt),$d(),i=l.flags,(i&65536)!==0&&(i&128)===0?(l.flags=i&-65537|128,l):null;case 5:return Sd(l),null;case 13:if(et(rt),i=l.memoizedState,i!==null&&i.dehydrated!==null){if(l.alternate===null)throw Error(s(340));hi()}return i=l.flags,i&65536?(l.flags=i&-65537|128,l):null;case 19:return et(rt),null;case 4:return gi(),null;case 10:return vd(l.type._context),null;case 22:case 23:return ih(),null;case 24:return null;default:return null}}var zl=!1,zt=!1,v3=typeof WeakSet=="function"?WeakSet:Set,ge=null;function yi(i,l){var h=i.ref;if(h!==null)if(typeof h=="function")try{h(null)}catch(g){ot(i,l,g)}else h.current=null}function Kd(i,l,h){try{h()}catch(g){ot(i,l,g)}}var K0=!1;function j3(i,l){if(id=el,i=S1(),Zu(i)){if("selectionStart"in i)var h={start:i.selectionStart,end:i.selectionEnd};else e:{h=(h=i.ownerDocument)&&h.defaultView||window;var g=h.getSelection&&h.getSelection();if(g&&g.rangeCount!==0){h=g.anchorNode;var j=g.anchorOffset,w=g.focusNode;g=g.focusOffset;try{h.nodeType,w.nodeType}catch{h=null;break e}var E=0,L=-1,W=-1,Z=0,ie=0,oe=i,re=null;t:for(;;){for(var fe;oe!==h||j!==0&&oe.nodeType!==3||(L=E+j),oe!==w||g!==0&&oe.nodeType!==3||(W=E+g),oe.nodeType===3&&(E+=oe.nodeValue.length),(fe=oe.firstChild)!==null;)re=oe,oe=fe;for(;;){if(oe===i)break t;if(re===h&&++Z===j&&(L=E),re===w&&++ie===g&&(W=E),(fe=oe.nextSibling)!==null)break;oe=re,re=oe.parentNode}oe=fe}h=L===-1||W===-1?null:{start:L,end:W}}else h=null}h=h||{start:0,end:0}}else h=null;for(ad={focusedElem:i,selectionRange:h},el=!1,ge=l;ge!==null;)if(l=ge,i=l.child,(l.subtreeFlags&1028)!==0&&i!==null)i.return=l,ge=i;else for(;ge!==null;){l=ge;try{var ye=l.alternate;if((l.flags&1024)!==0)switch(l.tag){case 0:case 11:case 15:break;case 1:if(ye!==null){var ve=ye.memoizedProps,dt=ye.memoizedState,Y=l.stateNode,U=Y.getSnapshotBeforeUpdate(l.elementType===l.type?ve:On(l.type,ve),dt);Y.__reactInternalSnapshotBeforeUpdate=U}break;case 3:var G=l.stateNode.containerInfo;G.nodeType===1?G.textContent="":G.nodeType===9&&G.documentElement&&G.removeChild(G.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(s(163))}}catch(de){ot(l,l.return,de)}if(i=l.sibling,i!==null){i.return=l.return,ge=i;break}ge=l.return}return ye=K0,K0=!1,ye}function Aa(i,l,h){var g=l.updateQueue;if(g=g!==null?g.lastEffect:null,g!==null){var j=g=g.next;do{if((j.tag&i)===i){var w=j.destroy;j.destroy=void 0,w!==void 0&&Kd(l,h,w)}j=j.next}while(j!==g)}}function Ml(i,l){if(l=l.updateQueue,l=l!==null?l.lastEffect:null,l!==null){var h=l=l.next;do{if((h.tag&i)===i){var g=h.create;h.destroy=g()}h=h.next}while(h!==l)}}function Yd(i){var l=i.ref;if(l!==null){var h=i.stateNode;switch(i.tag){case 5:i=h;break;default:i=h}typeof l=="function"?l(i):l.current=i}}function Y0(i){var l=i.alternate;l!==null&&(i.alternate=null,Y0(l)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(l=i.stateNode,l!==null&&(delete l[Xn],delete l[ka],delete l[ud],delete l[s3],delete l[r3])),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}function Q0(i){return i.tag===5||i.tag===3||i.tag===4}function G0(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||Q0(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function Qd(i,l,h){var g=i.tag;if(g===5||g===6)i=i.stateNode,l?h.nodeType===8?h.parentNode.insertBefore(i,l):h.insertBefore(i,l):(h.nodeType===8?(l=h.parentNode,l.insertBefore(i,h)):(l=h,l.appendChild(i)),h=h._reactRootContainer,h!=null||l.onclick!==null||(l.onclick=hl));else if(g!==4&&(i=i.child,i!==null))for(Qd(i,l,h),i=i.sibling;i!==null;)Qd(i,l,h),i=i.sibling}function Gd(i,l,h){var g=i.tag;if(g===5||g===6)i=i.stateNode,l?h.insertBefore(i,l):h.appendChild(i);else if(g!==4&&(i=i.child,i!==null))for(Gd(i,l,h),i=i.sibling;i!==null;)Gd(i,l,h),i=i.sibling}var Ct=null,qn=!1;function Ys(i,l,h){for(h=h.child;h!==null;)Z0(i,l,h),h=h.sibling}function Z0(i,l,h){if(Zn&&typeof Zn.onCommitFiberUnmount=="function")try{Zn.onCommitFiberUnmount(Yo,h)}catch{}switch(h.tag){case 5:zt||yi(h,l);case 6:var g=Ct,j=qn;Ct=null,Ys(i,l,h),Ct=g,qn=j,Ct!==null&&(qn?(i=Ct,h=h.stateNode,i.nodeType===8?i.parentNode.removeChild(h):i.removeChild(h)):Ct.removeChild(h.stateNode));break;case 18:Ct!==null&&(qn?(i=Ct,h=h.stateNode,i.nodeType===8?cd(i.parentNode,h):i.nodeType===1&&cd(i,h),la(i)):cd(Ct,h.stateNode));break;case 4:g=Ct,j=qn,Ct=h.stateNode.containerInfo,qn=!0,Ys(i,l,h),Ct=g,qn=j;break;case 0:case 11:case 14:case 15:if(!zt&&(g=h.updateQueue,g!==null&&(g=g.lastEffect,g!==null))){j=g=g.next;do{var w=j,E=w.destroy;w=w.tag,E!==void 0&&((w&2)!==0||(w&4)!==0)&&Kd(h,l,E),j=j.next}while(j!==g)}Ys(i,l,h);break;case 1:if(!zt&&(yi(h,l),g=h.stateNode,typeof g.componentWillUnmount=="function"))try{g.props=h.memoizedProps,g.state=h.memoizedState,g.componentWillUnmount()}catch(L){ot(h,l,L)}Ys(i,l,h);break;case 21:Ys(i,l,h);break;case 22:h.mode&1?(zt=(g=zt)||h.memoizedState!==null,Ys(i,l,h),zt=g):Ys(i,l,h);break;default:Ys(i,l,h)}}function X0(i){var l=i.updateQueue;if(l!==null){i.updateQueue=null;var h=i.stateNode;h===null&&(h=i.stateNode=new v3),l.forEach(function(g){var j=A3.bind(null,i,g);h.has(g)||(h.add(g),g.then(j,j))})}}function Dn(i,l){var h=l.deletions;if(h!==null)for(var g=0;g<h.length;g++){var j=h[g];try{var w=i,E=l,L=E;e:for(;L!==null;){switch(L.tag){case 5:Ct=L.stateNode,qn=!1;break e;case 3:Ct=L.stateNode.containerInfo,qn=!0;break e;case 4:Ct=L.stateNode.containerInfo,qn=!0;break e}L=L.return}if(Ct===null)throw Error(s(160));Z0(w,E,j),Ct=null,qn=!1;var W=j.alternate;W!==null&&(W.return=null),j.return=null}catch(Z){ot(j,l,Z)}}if(l.subtreeFlags&12854)for(l=l.child;l!==null;)J0(l,i),l=l.sibling}function J0(i,l){var h=i.alternate,g=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:if(Dn(l,i),ts(i),g&4){try{Aa(3,i,i.return),Ml(3,i)}catch(ve){ot(i,i.return,ve)}try{Aa(5,i,i.return)}catch(ve){ot(i,i.return,ve)}}break;case 1:Dn(l,i),ts(i),g&512&&h!==null&&yi(h,h.return);break;case 5:if(Dn(l,i),ts(i),g&512&&h!==null&&yi(h,h.return),i.flags&32){var j=i.stateNode;try{J(j,"")}catch(ve){ot(i,i.return,ve)}}if(g&4&&(j=i.stateNode,j!=null)){var w=i.memoizedProps,E=h!==null?h.memoizedProps:w,L=i.type,W=i.updateQueue;if(i.updateQueue=null,W!==null)try{L==="input"&&w.type==="radio"&&w.name!=null&&Mn(j,w),Gn(L,E);var Z=Gn(L,w);for(E=0;E<W.length;E+=2){var ie=W[E],oe=W[E+1];ie==="style"?yt(j,oe):ie==="dangerouslySetInnerHTML"?Me(j,oe):ie==="children"?J(j,oe):S(j,ie,oe,Z)}switch(L){case"input":bn(j,w);break;case"textarea":Qn(j,w);break;case"select":var re=j._wrapperState.wasMultiple;j._wrapperState.wasMultiple=!!w.multiple;var fe=w.value;fe!=null?cn(j,!!w.multiple,fe,!1):re!==!!w.multiple&&(w.defaultValue!=null?cn(j,!!w.multiple,w.defaultValue,!0):cn(j,!!w.multiple,w.multiple?[]:"",!1))}j[ka]=w}catch(ve){ot(i,i.return,ve)}}break;case 6:if(Dn(l,i),ts(i),g&4){if(i.stateNode===null)throw Error(s(162));j=i.stateNode,w=i.memoizedProps;try{j.nodeValue=w}catch(ve){ot(i,i.return,ve)}}break;case 3:if(Dn(l,i),ts(i),g&4&&h!==null&&h.memoizedState.isDehydrated)try{la(l.containerInfo)}catch(ve){ot(i,i.return,ve)}break;case 4:Dn(l,i),ts(i);break;case 13:Dn(l,i),ts(i),j=i.child,j.flags&8192&&(w=j.memoizedState!==null,j.stateNode.isHidden=w,!w||j.alternate!==null&&j.alternate.memoizedState!==null||(Jd=ut())),g&4&&X0(i);break;case 22:if(ie=h!==null&&h.memoizedState!==null,i.mode&1?(zt=(Z=zt)||ie,Dn(l,i),zt=Z):Dn(l,i),ts(i),g&8192){if(Z=i.memoizedState!==null,(i.stateNode.isHidden=Z)&&!ie&&(i.mode&1)!==0)for(ge=i,ie=i.child;ie!==null;){for(oe=ge=ie;ge!==null;){switch(re=ge,fe=re.child,re.tag){case 0:case 11:case 14:case 15:Aa(4,re,re.return);break;case 1:yi(re,re.return);var ye=re.stateNode;if(typeof ye.componentWillUnmount=="function"){g=re,h=re.return;try{l=g,ye.props=l.memoizedProps,ye.state=l.memoizedState,ye.componentWillUnmount()}catch(ve){ot(g,h,ve)}}break;case 5:yi(re,re.return);break;case 22:if(re.memoizedState!==null){ng(oe);continue}}fe!==null?(fe.return=re,ge=fe):ng(oe)}ie=ie.sibling}e:for(ie=null,oe=i;;){if(oe.tag===5){if(ie===null){ie=oe;try{j=oe.stateNode,Z?(w=j.style,typeof w.setProperty=="function"?w.setProperty("display","none","important"):w.display="none"):(L=oe.stateNode,W=oe.memoizedProps.style,E=W!=null&&W.hasOwnProperty("display")?W.display:null,L.style.display=st("display",E))}catch(ve){ot(i,i.return,ve)}}}else if(oe.tag===6){if(ie===null)try{oe.stateNode.nodeValue=Z?"":oe.memoizedProps}catch(ve){ot(i,i.return,ve)}}else if((oe.tag!==22&&oe.tag!==23||oe.memoizedState===null||oe===i)&&oe.child!==null){oe.child.return=oe,oe=oe.child;continue}if(oe===i)break e;for(;oe.sibling===null;){if(oe.return===null||oe.return===i)break e;ie===oe&&(ie=null),oe=oe.return}ie===oe&&(ie=null),oe.sibling.return=oe.return,oe=oe.sibling}}break;case 19:Dn(l,i),ts(i),g&4&&X0(i);break;case 21:break;default:Dn(l,i),ts(i)}}function ts(i){var l=i.flags;if(l&2){try{e:{for(var h=i.return;h!==null;){if(Q0(h)){var g=h;break e}h=h.return}throw Error(s(160))}switch(g.tag){case 5:var j=g.stateNode;g.flags&32&&(J(j,""),g.flags&=-33);var w=G0(i);Gd(i,w,j);break;case 3:case 4:var E=g.stateNode.containerInfo,L=G0(i);Qd(i,L,E);break;default:throw Error(s(161))}}catch(W){ot(i,i.return,W)}i.flags&=-3}l&4096&&(i.flags&=-4097)}function b3(i,l,h){ge=i,eg(i)}function eg(i,l,h){for(var g=(i.mode&1)!==0;ge!==null;){var j=ge,w=j.child;if(j.tag===22&&g){var E=j.memoizedState!==null||zl;if(!E){var L=j.alternate,W=L!==null&&L.memoizedState!==null||zt;L=zl;var Z=zt;if(zl=E,(zt=W)&&!Z)for(ge=j;ge!==null;)E=ge,W=E.child,E.tag===22&&E.memoizedState!==null?sg(j):W!==null?(W.return=E,ge=W):sg(j);for(;w!==null;)ge=w,eg(w),w=w.sibling;ge=j,zl=L,zt=Z}tg(i)}else(j.subtreeFlags&8772)!==0&&w!==null?(w.return=j,ge=w):tg(i)}}function tg(i){for(;ge!==null;){var l=ge;if((l.flags&8772)!==0){var h=l.alternate;try{if((l.flags&8772)!==0)switch(l.tag){case 0:case 11:case 15:zt||Ml(5,l);break;case 1:var g=l.stateNode;if(l.flags&4&&!zt)if(h===null)g.componentDidMount();else{var j=l.elementType===l.type?h.memoizedProps:On(l.type,h.memoizedProps);g.componentDidUpdate(j,h.memoizedState,g.__reactInternalSnapshotBeforeUpdate)}var w=l.updateQueue;w!==null&&n0(l,w,g);break;case 3:var E=l.updateQueue;if(E!==null){if(h=null,l.child!==null)switch(l.child.tag){case 5:h=l.child.stateNode;break;case 1:h=l.child.stateNode}n0(l,E,h)}break;case 5:var L=l.stateNode;if(h===null&&l.flags&4){h=L;var W=l.memoizedProps;switch(l.type){case"button":case"input":case"select":case"textarea":W.autoFocus&&h.focus();break;case"img":W.src&&(h.src=W.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(l.memoizedState===null){var Z=l.alternate;if(Z!==null){var ie=Z.memoizedState;if(ie!==null){var oe=ie.dehydrated;oe!==null&&la(oe)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(s(163))}zt||l.flags&512&&Yd(l)}catch(re){ot(l,l.return,re)}}if(l===i){ge=null;break}if(h=l.sibling,h!==null){h.return=l.return,ge=h;break}ge=l.return}}function ng(i){for(;ge!==null;){var l=ge;if(l===i){ge=null;break}var h=l.sibling;if(h!==null){h.return=l.return,ge=h;break}ge=l.return}}function sg(i){for(;ge!==null;){var l=ge;try{switch(l.tag){case 0:case 11:case 15:var h=l.return;try{Ml(4,l)}catch(W){ot(l,h,W)}break;case 1:var g=l.stateNode;if(typeof g.componentDidMount=="function"){var j=l.return;try{g.componentDidMount()}catch(W){ot(l,j,W)}}var w=l.return;try{Yd(l)}catch(W){ot(l,w,W)}break;case 5:var E=l.return;try{Yd(l)}catch(W){ot(l,E,W)}}}catch(W){ot(l,l.return,W)}if(l===i){ge=null;break}var L=l.sibling;if(L!==null){L.return=l.return,ge=L;break}ge=l.return}}var w3=Math.ceil,Fl=P.ReactCurrentDispatcher,Zd=P.ReactCurrentOwner,$n=P.ReactCurrentBatchConfig,We=0,vt=null,ht=null,$t=0,fn=0,ki=Ws(0),mt=0,Pa=null,br=0,Ll=0,Xd=0,Ra=null,Gt=null,Jd=0,vi=1/0,js=null,_l=!1,eh=null,Qs=null,Ol=!1,Gs=null,ql=0,Ia=0,th=null,Dl=-1,Bl=0;function Bt(){return(We&6)!==0?ut():Dl!==-1?Dl:Dl=ut()}function Zs(i){return(i.mode&1)===0?1:(We&2)!==0&&$t!==0?$t&-$t:a3.transition!==null?(Bl===0&&(Bl=Gm()),Bl):(i=Ke,i!==0||(i=window.event,i=i===void 0?16:i1(i.type)),i)}function Bn(i,l,h,g){if(50<Ia)throw Ia=0,th=null,Error(s(185));sa(i,h,g),((We&2)===0||i!==vt)&&(i===vt&&((We&2)===0&&(Ll|=h),mt===4&&Xs(i,$t)),Zt(i,g),h===1&&We===0&&(l.mode&1)===0&&(vi=ut()+500,gl&&Hs()))}function Zt(i,l){var h=i.callbackNode;aw(i,l);var g=Zo(i,i===vt?$t:0);if(g===0)h!==null&&Km(h),i.callbackNode=null,i.callbackPriority=0;else if(l=g&-g,i.callbackPriority!==l){if(h!=null&&Km(h),l===1)i.tag===0?i3(ig.bind(null,i)):U1(ig.bind(null,i)),t3(function(){(We&6)===0&&Hs()}),h=null;else{switch(Zm(g)){case 1:h=zu;break;case 4:h=Ym;break;case 16:h=Ko;break;case 536870912:h=Qm;break;default:h=Ko}h=pg(h,rg.bind(null,i))}i.callbackPriority=l,i.callbackNode=h}}function rg(i,l){if(Dl=-1,Bl=0,(We&6)!==0)throw Error(s(327));var h=i.callbackNode;if(ji()&&i.callbackNode!==h)return null;var g=Zo(i,i===vt?$t:0);if(g===0)return null;if((g&30)!==0||(g&i.expiredLanes)!==0||l)l=Wl(i,g);else{l=g;var j=We;We|=2;var w=og();(vt!==i||$t!==l)&&(js=null,vi=ut()+500,Nr(i,l));do try{C3();break}catch(L){ag(i,L)}while(!0);kd(),Fl.current=w,We=j,ht!==null?l=0:(vt=null,$t=0,l=mt)}if(l!==0){if(l===2&&(j=Mu(i),j!==0&&(g=j,l=nh(i,j))),l===1)throw h=Pa,Nr(i,0),Xs(i,g),Zt(i,ut()),h;if(l===6)Xs(i,g);else{if(j=i.current.alternate,(g&30)===0&&!N3(j)&&(l=Wl(i,g),l===2&&(w=Mu(i),w!==0&&(g=w,l=nh(i,w))),l===1))throw h=Pa,Nr(i,0),Xs(i,g),Zt(i,ut()),h;switch(i.finishedWork=j,i.finishedLanes=g,l){case 0:case 1:throw Error(s(345));case 2:Sr(i,Gt,js);break;case 3:if(Xs(i,g),(g&130023424)===g&&(l=Jd+500-ut(),10<l)){if(Zo(i,0)!==0)break;if(j=i.suspendedLanes,(j&g)!==g){Bt(),i.pingedLanes|=i.suspendedLanes&j;break}i.timeoutHandle=ld(Sr.bind(null,i,Gt,js),l);break}Sr(i,Gt,js);break;case 4:if(Xs(i,g),(g&4194240)===g)break;for(l=i.eventTimes,j=-1;0<g;){var E=31-Fn(g);w=1<<E,E=l[E],E>j&&(j=E),g&=~w}if(g=j,g=ut()-g,g=(120>g?120:480>g?480:1080>g?1080:1920>g?1920:3e3>g?3e3:4320>g?4320:1960*w3(g/1960))-g,10<g){i.timeoutHandle=ld(Sr.bind(null,i,Gt,js),g);break}Sr(i,Gt,js);break;case 5:Sr(i,Gt,js);break;default:throw Error(s(329))}}}return Zt(i,ut()),i.callbackNode===h?rg.bind(null,i):null}function nh(i,l){var h=Ra;return i.current.memoizedState.isDehydrated&&(Nr(i,l).flags|=256),i=Wl(i,l),i!==2&&(l=Gt,Gt=h,l!==null&&sh(l)),i}function sh(i){Gt===null?Gt=i:Gt.push.apply(Gt,i)}function N3(i){for(var l=i;;){if(l.flags&16384){var h=l.updateQueue;if(h!==null&&(h=h.stores,h!==null))for(var g=0;g<h.length;g++){var j=h[g],w=j.getSnapshot;j=j.value;try{if(!Ln(w(),j))return!1}catch{return!1}}}if(h=l.child,l.subtreeFlags&16384&&h!==null)h.return=l,l=h;else{if(l===i)break;for(;l.sibling===null;){if(l.return===null||l.return===i)return!0;l=l.return}l.sibling.return=l.return,l=l.sibling}}return!0}function Xs(i,l){for(l&=~Xd,l&=~Ll,i.suspendedLanes|=l,i.pingedLanes&=~l,i=i.expirationTimes;0<l;){var h=31-Fn(l),g=1<<h;i[h]=-1,l&=~g}}function ig(i){if((We&6)!==0)throw Error(s(327));ji();var l=Zo(i,0);if((l&1)===0)return Zt(i,ut()),null;var h=Wl(i,l);if(i.tag!==0&&h===2){var g=Mu(i);g!==0&&(l=g,h=nh(i,g))}if(h===1)throw h=Pa,Nr(i,0),Xs(i,l),Zt(i,ut()),h;if(h===6)throw Error(s(345));return i.finishedWork=i.current.alternate,i.finishedLanes=l,Sr(i,Gt,js),Zt(i,ut()),null}function rh(i,l){var h=We;We|=1;try{return i(l)}finally{We=h,We===0&&(vi=ut()+500,gl&&Hs())}}function wr(i){Gs!==null&&Gs.tag===0&&(We&6)===0&&ji();var l=We;We|=1;var h=$n.transition,g=Ke;try{if($n.transition=null,Ke=1,i)return i()}finally{Ke=g,$n.transition=h,We=l,(We&6)===0&&Hs()}}function ih(){fn=ki.current,et(ki)}function Nr(i,l){i.finishedWork=null,i.finishedLanes=0;var h=i.timeoutHandle;if(h!==-1&&(i.timeoutHandle=-1,e3(h)),ht!==null)for(h=ht.return;h!==null;){var g=h;switch(fd(g),g.tag){case 1:g=g.type.childContextTypes,g!=null&&fl();break;case 3:gi(),et(Kt),et(Pt),$d();break;case 5:Sd(g);break;case 4:gi();break;case 13:et(rt);break;case 19:et(rt);break;case 10:vd(g.type._context);break;case 22:case 23:ih()}h=h.return}if(vt=i,ht=i=Js(i.current,null),$t=fn=l,mt=0,Pa=null,Xd=Ll=br=0,Gt=Ra=null,kr!==null){for(l=0;l<kr.length;l++)if(h=kr[l],g=h.interleaved,g!==null){h.interleaved=null;var j=g.next,w=h.pending;if(w!==null){var E=w.next;w.next=j,g.next=E}h.pending=g}kr=null}return i}function ag(i,l){do{var h=ht;try{if(kd(),Cl.current=Al,$l){for(var g=it.memoizedState;g!==null;){var j=g.queue;j!==null&&(j.pending=null),g=g.next}$l=!1}if(jr=0,kt=ft=it=null,Sa=!1,Ca=0,Zd.current=null,h===null||h.return===null){mt=1,Pa=l,ht=null;break}e:{var w=i,E=h.return,L=h,W=l;if(l=$t,L.flags|=32768,W!==null&&typeof W=="object"&&typeof W.then=="function"){var Z=W,ie=L,oe=ie.tag;if((ie.mode&1)===0&&(oe===0||oe===11||oe===15)){var re=ie.alternate;re?(ie.updateQueue=re.updateQueue,ie.memoizedState=re.memoizedState,ie.lanes=re.lanes):(ie.updateQueue=null,ie.memoizedState=null)}var fe=P0(E);if(fe!==null){fe.flags&=-257,R0(fe,E,L,w,l),fe.mode&1&&A0(w,Z,l),l=fe,W=Z;var ye=l.updateQueue;if(ye===null){var ve=new Set;ve.add(W),l.updateQueue=ve}else ye.add(W);break e}else{if((l&1)===0){A0(w,Z,l),ah();break e}W=Error(s(426))}}else if(tt&&L.mode&1){var dt=P0(E);if(dt!==null){(dt.flags&65536)===0&&(dt.flags|=256),R0(dt,E,L,w,l),xd(xi(W,L));break e}}w=W=xi(W,L),mt!==4&&(mt=2),Ra===null?Ra=[w]:Ra.push(w),w=E;do{switch(w.tag){case 3:w.flags|=65536,l&=-l,w.lanes|=l;var Y=E0(w,W,l);t0(w,Y);break e;case 1:L=W;var U=w.type,G=w.stateNode;if((w.flags&128)===0&&(typeof U.getDerivedStateFromError=="function"||G!==null&&typeof G.componentDidCatch=="function"&&(Qs===null||!Qs.has(G)))){w.flags|=65536,l&=-l,w.lanes|=l;var de=T0(w,L,l);t0(w,de);break e}}w=w.return}while(w!==null)}cg(h)}catch(je){l=je,ht===h&&h!==null&&(ht=h=h.return);continue}break}while(!0)}function og(){var i=Fl.current;return Fl.current=Al,i===null?Al:i}function ah(){(mt===0||mt===3||mt===2)&&(mt=4),vt===null||(br&268435455)===0&&(Ll&268435455)===0||Xs(vt,$t)}function Wl(i,l){var h=We;We|=2;var g=og();(vt!==i||$t!==l)&&(js=null,Nr(i,l));do try{S3();break}catch(j){ag(i,j)}while(!0);if(kd(),We=h,Fl.current=g,ht!==null)throw Error(s(261));return vt=null,$t=0,mt}function S3(){for(;ht!==null;)lg(ht)}function C3(){for(;ht!==null&&!Zb();)lg(ht)}function lg(i){var l=hg(i.alternate,i,fn);i.memoizedProps=i.pendingProps,l===null?cg(i):ht=l,Zd.current=null}function cg(i){var l=i;do{var h=l.alternate;if(i=l.return,(l.flags&32768)===0){if(h=y3(h,l,fn),h!==null){ht=h;return}}else{if(h=k3(h,l),h!==null){h.flags&=32767,ht=h;return}if(i!==null)i.flags|=32768,i.subtreeFlags=0,i.deletions=null;else{mt=6,ht=null;return}}if(l=l.sibling,l!==null){ht=l;return}ht=l=i}while(l!==null);mt===0&&(mt=5)}function Sr(i,l,h){var g=Ke,j=$n.transition;try{$n.transition=null,Ke=1,$3(i,l,h,g)}finally{$n.transition=j,Ke=g}return null}function $3(i,l,h,g){do ji();while(Gs!==null);if((We&6)!==0)throw Error(s(327));h=i.finishedWork;var j=i.finishedLanes;if(h===null)return null;if(i.finishedWork=null,i.finishedLanes=0,h===i.current)throw Error(s(177));i.callbackNode=null,i.callbackPriority=0;var w=h.lanes|h.childLanes;if(ow(i,w),i===vt&&(ht=vt=null,$t=0),(h.subtreeFlags&2064)===0&&(h.flags&2064)===0||Ol||(Ol=!0,pg(Ko,function(){return ji(),null})),w=(h.flags&15990)!==0,(h.subtreeFlags&15990)!==0||w){w=$n.transition,$n.transition=null;var E=Ke;Ke=1;var L=We;We|=4,Zd.current=null,j3(i,h),J0(h,i),Kw(ad),el=!!id,ad=id=null,i.current=h,b3(h),Xb(),We=L,Ke=E,$n.transition=w}else i.current=h;if(Ol&&(Ol=!1,Gs=i,ql=j),w=i.pendingLanes,w===0&&(Qs=null),tw(h.stateNode),Zt(i,ut()),l!==null)for(g=i.onRecoverableError,h=0;h<l.length;h++)j=l[h],g(j.value,{componentStack:j.stack,digest:j.digest});if(_l)throw _l=!1,i=eh,eh=null,i;return(ql&1)!==0&&i.tag!==0&&ji(),w=i.pendingLanes,(w&1)!==0?i===th?Ia++:(Ia=0,th=i):Ia=0,Hs(),null}function ji(){if(Gs!==null){var i=Zm(ql),l=$n.transition,h=Ke;try{if($n.transition=null,Ke=16>i?16:i,Gs===null)var g=!1;else{if(i=Gs,Gs=null,ql=0,(We&6)!==0)throw Error(s(331));var j=We;for(We|=4,ge=i.current;ge!==null;){var w=ge,E=w.child;if((ge.flags&16)!==0){var L=w.deletions;if(L!==null){for(var W=0;W<L.length;W++){var Z=L[W];for(ge=Z;ge!==null;){var ie=ge;switch(ie.tag){case 0:case 11:case 15:Aa(8,ie,w)}var oe=ie.child;if(oe!==null)oe.return=ie,ge=oe;else for(;ge!==null;){ie=ge;var re=ie.sibling,fe=ie.return;if(Y0(ie),ie===Z){ge=null;break}if(re!==null){re.return=fe,ge=re;break}ge=fe}}}var ye=w.alternate;if(ye!==null){var ve=ye.child;if(ve!==null){ye.child=null;do{var dt=ve.sibling;ve.sibling=null,ve=dt}while(ve!==null)}}ge=w}}if((w.subtreeFlags&2064)!==0&&E!==null)E.return=w,ge=E;else e:for(;ge!==null;){if(w=ge,(w.flags&2048)!==0)switch(w.tag){case 0:case 11:case 15:Aa(9,w,w.return)}var Y=w.sibling;if(Y!==null){Y.return=w.return,ge=Y;break e}ge=w.return}}var U=i.current;for(ge=U;ge!==null;){E=ge;var G=E.child;if((E.subtreeFlags&2064)!==0&&G!==null)G.return=E,ge=G;else e:for(E=U;ge!==null;){if(L=ge,(L.flags&2048)!==0)try{switch(L.tag){case 0:case 11:case 15:Ml(9,L)}}catch(je){ot(L,L.return,je)}if(L===E){ge=null;break e}var de=L.sibling;if(de!==null){de.return=L.return,ge=de;break e}ge=L.return}}if(We=j,Hs(),Zn&&typeof Zn.onPostCommitFiberRoot=="function")try{Zn.onPostCommitFiberRoot(Yo,i)}catch{}g=!0}return g}finally{Ke=h,$n.transition=l}}return!1}function ug(i,l,h){l=xi(h,l),l=E0(i,l,1),i=Ks(i,l,1),l=Bt(),i!==null&&(sa(i,1,l),Zt(i,l))}function ot(i,l,h){if(i.tag===3)ug(i,i,h);else for(;l!==null;){if(l.tag===3){ug(l,i,h);break}else if(l.tag===1){var g=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof g.componentDidCatch=="function"&&(Qs===null||!Qs.has(g))){i=xi(h,i),i=T0(l,i,1),l=Ks(l,i,1),i=Bt(),l!==null&&(sa(l,1,i),Zt(l,i));break}}l=l.return}}function E3(i,l,h){var g=i.pingCache;g!==null&&g.delete(l),l=Bt(),i.pingedLanes|=i.suspendedLanes&h,vt===i&&($t&h)===h&&(mt===4||mt===3&&($t&130023424)===$t&&500>ut()-Jd?Nr(i,0):Xd|=h),Zt(i,l)}function dg(i,l){l===0&&((i.mode&1)===0?l=1:(l=Go,Go<<=1,(Go&130023424)===0&&(Go=4194304)));var h=Bt();i=ys(i,l),i!==null&&(sa(i,l,h),Zt(i,h))}function T3(i){var l=i.memoizedState,h=0;l!==null&&(h=l.retryLane),dg(i,h)}function A3(i,l){var h=0;switch(i.tag){case 13:var g=i.stateNode,j=i.memoizedState;j!==null&&(h=j.retryLane);break;case 19:g=i.stateNode;break;default:throw Error(s(314))}g!==null&&g.delete(l),dg(i,h)}var hg;hg=function(i,l,h){if(i!==null)if(i.memoizedProps!==l.pendingProps||Kt.current)Qt=!0;else{if((i.lanes&h)===0&&(l.flags&128)===0)return Qt=!1,x3(i,l,h);Qt=(i.flags&131072)!==0}else Qt=!1,tt&&(l.flags&1048576)!==0&&H1(l,yl,l.index);switch(l.lanes=0,l.tag){case 2:var g=l.type;Il(i,l),i=l.pendingProps;var j=ci(l,Pt.current);mi(l,h),j=Ad(null,l,g,i,j,h);var w=Pd();return l.flags|=1,typeof j=="object"&&j!==null&&typeof j.render=="function"&&j.$$typeof===void 0?(l.tag=1,l.memoizedState=null,l.updateQueue=null,Yt(g)?(w=!0,ml(l)):w=!1,l.memoizedState=j.state!==null&&j.state!==void 0?j.state:null,wd(l),j.updater=Pl,l.stateNode=j,j._reactInternals=l,Ld(l,g,i,h),l=Dd(null,l,g,!0,w,h)):(l.tag=0,tt&&w&&pd(l),Dt(null,l,j,h),l=l.child),l;case 16:g=l.elementType;e:{switch(Il(i,l),i=l.pendingProps,j=g._init,g=j(g._payload),l.type=g,j=l.tag=R3(g),i=On(g,i),j){case 0:l=qd(null,l,g,i,h);break e;case 1:l=_0(null,l,g,i,h);break e;case 11:l=I0(null,l,g,i,h);break e;case 14:l=z0(null,l,g,On(g.type,i),h);break e}throw Error(s(306,g,""))}return l;case 0:return g=l.type,j=l.pendingProps,j=l.elementType===g?j:On(g,j),qd(i,l,g,j,h);case 1:return g=l.type,j=l.pendingProps,j=l.elementType===g?j:On(g,j),_0(i,l,g,j,h);case 3:e:{if(O0(l),i===null)throw Error(s(387));g=l.pendingProps,w=l.memoizedState,j=w.element,e0(i,l),Nl(l,g,null,h);var E=l.memoizedState;if(g=E.element,w.isDehydrated)if(w={element:g,isDehydrated:!1,cache:E.cache,pendingSuspenseBoundaries:E.pendingSuspenseBoundaries,transitions:E.transitions},l.updateQueue.baseState=w,l.memoizedState=w,l.flags&256){j=xi(Error(s(423)),l),l=q0(i,l,g,h,j);break e}else if(g!==j){j=xi(Error(s(424)),l),l=q0(i,l,g,h,j);break e}else for(pn=Bs(l.stateNode.containerInfo.firstChild),hn=l,tt=!0,_n=null,h=X1(l,null,g,h),l.child=h;h;)h.flags=h.flags&-3|4096,h=h.sibling;else{if(hi(),g===j){l=vs(i,l,h);break e}Dt(i,l,g,h)}l=l.child}return l;case 5:return s0(l),i===null&&gd(l),g=l.type,j=l.pendingProps,w=i!==null?i.memoizedProps:null,E=j.children,od(g,j)?E=null:w!==null&&od(g,w)&&(l.flags|=32),L0(i,l),Dt(i,l,E,h),l.child;case 6:return i===null&&gd(l),null;case 13:return D0(i,l,h);case 4:return Nd(l,l.stateNode.containerInfo),g=l.pendingProps,i===null?l.child=pi(l,null,g,h):Dt(i,l,g,h),l.child;case 11:return g=l.type,j=l.pendingProps,j=l.elementType===g?j:On(g,j),I0(i,l,g,j,h);case 7:return Dt(i,l,l.pendingProps,h),l.child;case 8:return Dt(i,l,l.pendingProps.children,h),l.child;case 12:return Dt(i,l,l.pendingProps.children,h),l.child;case 10:e:{if(g=l.type._context,j=l.pendingProps,w=l.memoizedProps,E=j.value,Ge(jl,g._currentValue),g._currentValue=E,w!==null)if(Ln(w.value,E)){if(w.children===j.children&&!Kt.current){l=vs(i,l,h);break e}}else for(w=l.child,w!==null&&(w.return=l);w!==null;){var L=w.dependencies;if(L!==null){E=w.child;for(var W=L.firstContext;W!==null;){if(W.context===g){if(w.tag===1){W=ks(-1,h&-h),W.tag=2;var Z=w.updateQueue;if(Z!==null){Z=Z.shared;var ie=Z.pending;ie===null?W.next=W:(W.next=ie.next,ie.next=W),Z.pending=W}}w.lanes|=h,W=w.alternate,W!==null&&(W.lanes|=h),jd(w.return,h,l),L.lanes|=h;break}W=W.next}}else if(w.tag===10)E=w.type===l.type?null:w.child;else if(w.tag===18){if(E=w.return,E===null)throw Error(s(341));E.lanes|=h,L=E.alternate,L!==null&&(L.lanes|=h),jd(E,h,l),E=w.sibling}else E=w.child;if(E!==null)E.return=w;else for(E=w;E!==null;){if(E===l){E=null;break}if(w=E.sibling,w!==null){w.return=E.return,E=w;break}E=E.return}w=E}Dt(i,l,j.children,h),l=l.child}return l;case 9:return j=l.type,g=l.pendingProps.children,mi(l,h),j=Sn(j),g=g(j),l.flags|=1,Dt(i,l,g,h),l.child;case 14:return g=l.type,j=On(g,l.pendingProps),j=On(g.type,j),z0(i,l,g,j,h);case 15:return M0(i,l,l.type,l.pendingProps,h);case 17:return g=l.type,j=l.pendingProps,j=l.elementType===g?j:On(g,j),Il(i,l),l.tag=1,Yt(g)?(i=!0,ml(l)):i=!1,mi(l,h),C0(l,g,j),Ld(l,g,j,h),Dd(null,l,g,!0,i,h);case 19:return W0(i,l,h);case 22:return F0(i,l,h)}throw Error(s(156,l.tag))};function pg(i,l){return Vm(i,l)}function P3(i,l,h,g){this.tag=i,this.key=h,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=l,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=g,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function En(i,l,h,g){return new P3(i,l,h,g)}function oh(i){return i=i.prototype,!(!i||!i.isReactComponent)}function R3(i){if(typeof i=="function")return oh(i)?1:0;if(i!=null){if(i=i.$$typeof,i===_)return 11;if(i===K)return 14}return 2}function Js(i,l){var h=i.alternate;return h===null?(h=En(i.tag,l,i.key,i.mode),h.elementType=i.elementType,h.type=i.type,h.stateNode=i.stateNode,h.alternate=i,i.alternate=h):(h.pendingProps=l,h.type=i.type,h.flags=0,h.subtreeFlags=0,h.deletions=null),h.flags=i.flags&14680064,h.childLanes=i.childLanes,h.lanes=i.lanes,h.child=i.child,h.memoizedProps=i.memoizedProps,h.memoizedState=i.memoizedState,h.updateQueue=i.updateQueue,l=i.dependencies,h.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext},h.sibling=i.sibling,h.index=i.index,h.ref=i.ref,h}function Ul(i,l,h,g,j,w){var E=2;if(g=i,typeof i=="function")oh(i)&&(E=1);else if(typeof i=="string")E=5;else e:switch(i){case F:return Cr(h.children,j,w,l);case R:E=8,j|=8;break;case B:return i=En(12,h,l,j|2),i.elementType=B,i.lanes=w,i;case Q:return i=En(13,h,l,j),i.elementType=Q,i.lanes=w,i;case q:return i=En(19,h,l,j),i.elementType=q,i.lanes=w,i;case H:return Hl(h,j,w,l);default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case I:E=10;break e;case O:E=9;break e;case _:E=11;break e;case K:E=14;break e;case ce:E=16,g=null;break e}throw Error(s(130,i==null?i:typeof i,""))}return l=En(E,h,l,j),l.elementType=i,l.type=g,l.lanes=w,l}function Cr(i,l,h,g){return i=En(7,i,g,l),i.lanes=h,i}function Hl(i,l,h,g){return i=En(22,i,g,l),i.elementType=H,i.lanes=h,i.stateNode={isHidden:!1},i}function lh(i,l,h){return i=En(6,i,null,l),i.lanes=h,i}function ch(i,l,h){return l=En(4,i.children!==null?i.children:[],i.key,l),l.lanes=h,l.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},l}function I3(i,l,h,g,j){this.tag=l,this.containerInfo=i,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Fu(0),this.expirationTimes=Fu(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Fu(0),this.identifierPrefix=g,this.onRecoverableError=j,this.mutableSourceEagerHydrationData=null}function uh(i,l,h,g,j,w,E,L,W){return i=new I3(i,l,h,L,W),l===1?(l=1,w===!0&&(l|=8)):l=0,w=En(3,null,null,l),i.current=w,w.stateNode=i,w.memoizedState={element:g,isDehydrated:h,cache:null,transitions:null,pendingSuspenseBoundaries:null},wd(w),i}function z3(i,l,h){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:T,key:g==null?null:""+g,children:i,containerInfo:l,implementation:h}}function fg(i){if(!i)return Us;i=i._reactInternals;e:{if(fr(i)!==i||i.tag!==1)throw Error(s(170));var l=i;do{switch(l.tag){case 3:l=l.stateNode.context;break e;case 1:if(Yt(l.type)){l=l.stateNode.__reactInternalMemoizedMergedChildContext;break e}}l=l.return}while(l!==null);throw Error(s(171))}if(i.tag===1){var h=i.type;if(Yt(h))return B1(i,h,l)}return l}function mg(i,l,h,g,j,w,E,L,W){return i=uh(h,g,!0,i,j,w,E,L,W),i.context=fg(null),h=i.current,g=Bt(),j=Zs(h),w=ks(g,j),w.callback=l??null,Ks(h,w,j),i.current.lanes=j,sa(i,j,g),Zt(i,g),i}function Vl(i,l,h,g){var j=l.current,w=Bt(),E=Zs(j);return h=fg(h),l.context===null?l.context=h:l.pendingContext=h,l=ks(w,E),l.payload={element:i},g=g===void 0?null:g,g!==null&&(l.callback=g),i=Ks(j,l,E),i!==null&&(Bn(i,j,E,w),wl(i,j,E)),E}function Kl(i){if(i=i.current,!i.child)return null;switch(i.child.tag){case 5:return i.child.stateNode;default:return i.child.stateNode}}function gg(i,l){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var h=i.retryLane;i.retryLane=h!==0&&h<l?h:l}}function dh(i,l){gg(i,l),(i=i.alternate)&&gg(i,l)}function M3(){return null}var xg=typeof reportError=="function"?reportError:function(i){console.error(i)};function hh(i){this._internalRoot=i}Yl.prototype.render=hh.prototype.render=function(i){var l=this._internalRoot;if(l===null)throw Error(s(409));Vl(i,l,null,null)},Yl.prototype.unmount=hh.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var l=i.containerInfo;wr(function(){Vl(null,i,null,null)}),l[fs]=null}};function Yl(i){this._internalRoot=i}Yl.prototype.unstable_scheduleHydration=function(i){if(i){var l=e1();i={blockedOn:null,target:i,priority:l};for(var h=0;h<Os.length&&l!==0&&l<Os[h].priority;h++);Os.splice(h,0,i),h===0&&s1(i)}};function ph(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function Ql(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11&&(i.nodeType!==8||i.nodeValue!==" react-mount-point-unstable "))}function yg(){}function F3(i,l,h,g,j){if(j){if(typeof g=="function"){var w=g;g=function(){var Z=Kl(E);w.call(Z)}}var E=mg(l,g,i,0,null,!1,!1,"",yg);return i._reactRootContainer=E,i[fs]=E.current,xa(i.nodeType===8?i.parentNode:i),wr(),E}for(;j=i.lastChild;)i.removeChild(j);if(typeof g=="function"){var L=g;g=function(){var Z=Kl(W);L.call(Z)}}var W=uh(i,0,!1,null,null,!1,!1,"",yg);return i._reactRootContainer=W,i[fs]=W.current,xa(i.nodeType===8?i.parentNode:i),wr(function(){Vl(l,W,h,g)}),W}function Gl(i,l,h,g,j){var w=h._reactRootContainer;if(w){var E=w;if(typeof j=="function"){var L=j;j=function(){var W=Kl(E);L.call(W)}}Vl(l,E,i,j)}else E=F3(h,l,i,j,g);return Kl(E)}Xm=function(i){switch(i.tag){case 3:var l=i.stateNode;if(l.current.memoizedState.isDehydrated){var h=na(l.pendingLanes);h!==0&&(Lu(l,h|1),Zt(l,ut()),(We&6)===0&&(vi=ut()+500,Hs()))}break;case 13:wr(function(){var g=ys(i,1);if(g!==null){var j=Bt();Bn(g,i,1,j)}}),dh(i,1)}},_u=function(i){if(i.tag===13){var l=ys(i,134217728);if(l!==null){var h=Bt();Bn(l,i,134217728,h)}dh(i,134217728)}},Jm=function(i){if(i.tag===13){var l=Zs(i),h=ys(i,l);if(h!==null){var g=Bt();Bn(h,i,l,g)}dh(i,l)}},e1=function(){return Ke},t1=function(i,l){var h=Ke;try{return Ke=i,l()}finally{Ke=h}},Au=function(i,l,h){switch(l){case"input":if(bn(i,h),l=h.name,h.type==="radio"&&l!=null){for(h=i;h.parentNode;)h=h.parentNode;for(h=h.querySelectorAll("input[name="+JSON.stringify(""+l)+'][type="radio"]'),l=0;l<h.length;l++){var g=h[l];if(g!==i&&g.form===i.form){var j=pl(g);if(!j)throw Error(s(90));Ut(g),bn(g,j)}}}break;case"textarea":Qn(i,h);break;case"select":l=h.value,l!=null&&cn(i,!!h.multiple,l,!1)}},Om=rh,qm=wr;var L3={usingClientEntryPoint:!1,Events:[va,oi,pl,Lm,_m,rh]},za={findFiberByHostInstance:mr,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},_3={bundleType:za.bundleType,version:za.version,rendererPackageName:za.rendererPackageName,rendererConfig:za.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:P.ReactCurrentDispatcher,findHostInstanceByFiber:function(i){return i=Um(i),i===null?null:i.stateNode},findFiberByHostInstance:za.findFiberByHostInstance||M3,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Zl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Zl.isDisabled&&Zl.supportsFiber)try{Yo=Zl.inject(_3),Zn=Zl}catch{}}return Xt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=L3,Xt.createPortal=function(i,l){var h=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!ph(l))throw Error(s(200));return z3(i,l,null,h)},Xt.createRoot=function(i,l){if(!ph(i))throw Error(s(299));var h=!1,g="",j=xg;return l!=null&&(l.unstable_strictMode===!0&&(h=!0),l.identifierPrefix!==void 0&&(g=l.identifierPrefix),l.onRecoverableError!==void 0&&(j=l.onRecoverableError)),l=uh(i,1,!1,null,null,h,!1,g,j),i[fs]=l.current,xa(i.nodeType===8?i.parentNode:i),new hh(l)},Xt.findDOMNode=function(i){if(i==null)return null;if(i.nodeType===1)return i;var l=i._reactInternals;if(l===void 0)throw typeof i.render=="function"?Error(s(188)):(i=Object.keys(i).join(","),Error(s(268,i)));return i=Um(l),i=i===null?null:i.stateNode,i},Xt.flushSync=function(i){return wr(i)},Xt.hydrate=function(i,l,h){if(!Ql(l))throw Error(s(200));return Gl(null,i,l,!0,h)},Xt.hydrateRoot=function(i,l,h){if(!ph(i))throw Error(s(405));var g=h!=null&&h.hydratedSources||null,j=!1,w="",E=xg;if(h!=null&&(h.unstable_strictMode===!0&&(j=!0),h.identifierPrefix!==void 0&&(w=h.identifierPrefix),h.onRecoverableError!==void 0&&(E=h.onRecoverableError)),l=mg(l,null,i,1,h??null,j,!1,w,E),i[fs]=l.current,xa(i),g)for(i=0;i<g.length;i++)h=g[i],j=h._getVersion,j=j(h._source),l.mutableSourceEagerHydrationData==null?l.mutableSourceEagerHydrationData=[h,j]:l.mutableSourceEagerHydrationData.push(h,j);return new Yl(l)},Xt.render=function(i,l,h){if(!Ql(l))throw Error(s(200));return Gl(null,i,l,!1,h)},Xt.unmountComponentAtNode=function(i){if(!Ql(i))throw Error(s(40));return i._reactRootContainer?(wr(function(){Gl(null,null,i,!1,function(){i._reactRootContainer=null,i[fs]=null})}),!0):!1},Xt.unstable_batchedUpdates=rh,Xt.unstable_renderSubtreeIntoContainer=function(i,l,h,g){if(!Ql(h))throw Error(s(200));if(i==null||i._reactInternals===void 0)throw Error(s(38));return Gl(i,l,h,!1,g)},Xt.version="18.3.1-next-f1338f8080-20240426",Xt}var Cg;function d2(){if(Cg)return gh.exports;Cg=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),gh.exports=H3(),gh.exports}var $g;function V3(){if($g)return Xl;$g=1;var e=d2();return Xl.createRoot=e.createRoot,Xl.hydrateRoot=e.hydrateRoot,Xl}var K3=V3(),Wr=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Y3=class extends Wr{#t;#e;#n;constructor(){super(),this.#n=e=>{if(typeof window<"u"&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}}}onSubscribe(){this.#e||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(e){this.#n=e,this.#e?.(),this.#e=e(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()})}setFocused(e){this.#t!==e&&(this.#t=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(n=>{n(e)})}isFocused(){return typeof this.#t=="boolean"?this.#t:globalThis.document?.visibilityState!=="hidden"}},pf=new Y3,Q3={setTimeout:(e,n)=>setTimeout(e,n),clearTimeout:e=>clearTimeout(e),setInterval:(e,n)=>setInterval(e,n),clearInterval:e=>clearInterval(e)},G3=class{#t=Q3;#e=!1;setTimeoutProvider(e){this.#t=e}setTimeout(e,n){return this.#t.setTimeout(e,n)}clearTimeout(e){this.#t.clearTimeout(e)}setInterval(e,n){return this.#t.setInterval(e,n)}clearInterval(e){this.#t.clearInterval(e)}},Tr=new G3;function Z3(e){setTimeout(e,0)}var X3=typeof window>"u"||"Deno"in globalThis;function Mt(){}function J3(e,n){return typeof e=="function"?e(n):e}function fp(e){return typeof e=="number"&&e>=0&&e!==1/0}function h2(e,n){return Math.max(e+(n||0)-Date.now(),0)}function lr(e,n){return typeof e=="function"?e(n):e}function xn(e,n){return typeof e=="function"?e(n):e}function Eg(e,n){const{type:s="all",exact:r,fetchStatus:a,predicate:o,queryKey:c,stale:u}=e;if(c){if(r){if(n.queryHash!==ff(c,n.options))return!1}else if(!eo(n.queryKey,c))return!1}if(s!=="all"){const d=n.isActive();if(s==="active"&&!d||s==="inactive"&&d)return!1}return!(typeof u=="boolean"&&n.isStale()!==u||a&&a!==n.state.fetchStatus||o&&!o(n))}function Tg(e,n){const{exact:s,status:r,predicate:a,mutationKey:o}=e;if(o){if(!n.options.mutationKey)return!1;if(s){if(Or(n.options.mutationKey)!==Or(o))return!1}else if(!eo(n.options.mutationKey,o))return!1}return!(r&&n.state.status!==r||a&&!a(n))}function ff(e,n){return(n?.queryKeyHashFn||Or)(e)}function Or(e){return JSON.stringify(e,(n,s)=>mp(s)?Object.keys(s).sort().reduce((r,a)=>(r[a]=s[a],r),{}):s)}function eo(e,n){return e===n?!0:typeof e!=typeof n?!1:e&&n&&typeof e=="object"&&typeof n=="object"?Object.keys(n).every(s=>eo(e[s],n[s])):!1}var e4=Object.prototype.hasOwnProperty;function mf(e,n,s=0){if(e===n)return e;if(s>500)return n;const r=Ag(e)&&Ag(n);if(!r&&!(mp(e)&&mp(n)))return n;const o=(r?e:Object.keys(e)).length,c=r?n:Object.keys(n),u=c.length,d=r?new Array(u):{};let p=0;for(let f=0;f<u;f++){const m=r?f:c[f],y=e[m],x=n[m];if(y===x){d[m]=y,(r?f<o:e4.call(e,m))&&p++;continue}if(y===null||x===null||typeof y!="object"||typeof x!="object"){d[m]=x;continue}const k=mf(y,x,s+1);d[m]=k,k===y&&p++}return o===u&&p===o?e:d}function to(e,n){if(!n||Object.keys(e).length!==Object.keys(n).length)return!1;for(const s in e)if(e[s]!==n[s])return!1;return!0}function Ag(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function mp(e){if(!Pg(e))return!1;const n=e.constructor;if(n===void 0)return!0;const s=n.prototype;return!(!Pg(s)||!s.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Pg(e){return Object.prototype.toString.call(e)==="[object Object]"}function t4(e){return new Promise(n=>{Tr.setTimeout(n,e)})}function gp(e,n,s){return typeof s.structuralSharing=="function"?s.structuralSharing(e,n):s.structuralSharing!==!1?mf(e,n):n}function n4(e){return e}function s4(e,n,s=0){const r=[...e,n];return s&&r.length>s?r.slice(1):r}function r4(e,n,s=0){const r=[n,...e];return s&&r.length>s?r.slice(0,-1):r}var gf=Symbol();function p2(e,n){return!e.queryFn&&n?.initialPromise?()=>n.initialPromise:!e.queryFn||e.queryFn===gf?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function xf(e,n){return typeof e=="function"?e(...n):!!e}function i4(e,n,s){let r=!1,a;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(a??=n(),r||(r=!0,a.aborted?s():a.addEventListener("abort",s,{once:!0})),a)}),e}var no=(()=>{let e=()=>X3;return{isServer(){return e()},setIsServer(n){e=n}}})();function xp(){let e,n;const s=new Promise((a,o)=>{e=a,n=o});s.status="pending",s.catch(()=>{});function r(a){Object.assign(s,a),delete s.resolve,delete s.reject}return s.resolve=a=>{r({status:"fulfilled",value:a}),e(a)},s.reject=a=>{r({status:"rejected",reason:a}),n(a)},s}var a4=Z3;function o4(){let e=[],n=0,s=u=>{u()},r=u=>{u()},a=a4;const o=u=>{n?e.push(u):a(()=>{s(u)})},c=()=>{const u=e;e=[],u.length&&a(()=>{r(()=>{u.forEach(d=>{s(d)})})})};return{batch:u=>{let d;n++;try{d=u()}finally{n--,n||c()}return d},batchCalls:u=>(...d)=>{o(()=>{u(...d)})},schedule:o,setNotifyFunction:u=>{s=u},setBatchNotifyFunction:u=>{r=u},setScheduler:u=>{a=u}}}var lt=o4(),l4=class extends Wr{#t=!0;#e;#n;constructor(){super(),this.#n=e=>{if(typeof window<"u"&&window.addEventListener){const n=()=>e(!0),s=()=>e(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",s,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",s)}}}}onSubscribe(){this.#e||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(e){this.#n=e,this.#e?.(),this.#e=e(this.setOnline.bind(this))}setOnline(e){this.#t!==e&&(this.#t=e,this.listeners.forEach(s=>{s(e)}))}isOnline(){return this.#t}},bc=new l4;function c4(e){return Math.min(1e3*2**e,3e4)}function f2(e){return(e??"online")==="online"?bc.isOnline():!0}var yp=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function m2(e){let n=!1,s=0,r;const a=xp(),o=()=>a.status!=="pending",c=v=>{if(!o()){const b=new yp(v);y(b),e.onCancel?.(b)}},u=()=>{n=!0},d=()=>{n=!1},p=()=>pf.isFocused()&&(e.networkMode==="always"||bc.isOnline())&&e.canRun(),f=()=>f2(e.networkMode)&&e.canRun(),m=v=>{o()||(r?.(),a.resolve(v))},y=v=>{o()||(r?.(),a.reject(v))},x=()=>new Promise(v=>{r=b=>{(o()||p())&&v(b)},e.onPause?.()}).then(()=>{r=void 0,o()||e.onContinue?.()}),k=()=>{if(o())return;let v;const b=s===0?e.initialPromise:void 0;try{v=b??e.fn()}catch(N){v=Promise.reject(N)}Promise.resolve(v).then(m).catch(N=>{if(o())return;const C=e.retry??(no.isServer()?0:3),S=e.retryDelay??c4,P=typeof S=="function"?S(s,N):S,M=C===!0||typeof C=="number"&&s<C||typeof C=="function"&&C(s,N);if(n||!M){y(N);return}s++,e.onFail?.(s,N),t4(P).then(()=>p()?void 0:x()).then(()=>{n?y(N):k()})})};return{promise:a,status:()=>a.status,cancel:c,continue:()=>(r?.(),a),cancelRetry:u,continueRetry:d,canStart:f,start:()=>(f()?k():x().then(k),a)}}var g2=class{#t;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),fp(this.gcTime)&&(this.#t=Tr.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(no.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#t!==void 0&&(Tr.clearTimeout(this.#t),this.#t=void 0)}};function u4(e){return{onFetch:(n,s)=>{const r=n.options,a=n.fetchOptions?.meta?.fetchMore?.direction,o=n.state.data?.pages||[],c=n.state.data?.pageParams||[];let u={pages:[],pageParams:[]},d=0;const p=async()=>{let f=!1;const m=k=>{i4(k,()=>n.signal,()=>f=!0)},y=p2(n.options,n.fetchOptions),x=async(k,v,b)=>{if(f)return Promise.reject(n.signal.reason);if(v==null&&k.pages.length)return Promise.resolve(k);const C=(()=>{const T={client:n.client,queryKey:n.queryKey,pageParam:v,direction:b?"backward":"forward",meta:n.options.meta};return m(T),T})(),S=await y(C),{maxPages:P}=n.options,M=b?r4:s4;return{pages:M(k.pages,S,P),pageParams:M(k.pageParams,v,P)}};if(a&&o.length){const k=a==="backward",v=k?d4:Rg,b={pages:o,pageParams:c},N=v(r,b);u=await x(b,N,k)}else{const k=e??o.length;do{const v=d===0?c[0]??r.initialPageParam:Rg(r,u);if(d>0&&v==null)break;u=await x(u,v),d++}while(d<k)}return u};n.options.persister?n.fetchFn=()=>n.options.persister?.(p,{client:n.client,queryKey:n.queryKey,meta:n.options.meta,signal:n.signal},s):n.fetchFn=p}}}function Rg(e,{pages:n,pageParams:s}){const r=n.length-1;return n.length>0?e.getNextPageParam(n[r],n,s[r],s):void 0}function d4(e,{pages:n,pageParams:s}){return n.length>0?e.getPreviousPageParam?.(n[0],n,s[0],s):void 0}var h4=class extends g2{#t;#e;#n;#s;#r;#i;#o;#a;constructor(e){super(),this.#a=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#r=e.client,this.#s=this.#r.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=zg(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#t}get promise(){return this.#i?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#t=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=zg(this.options);n.data!==void 0&&(this.setState(Ig(n.data,n.dataUpdatedAt)),this.#e=n)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#s.remove(this)}setData(e,n){const s=gp(this.state.data,e,this.options);return this.#l({data:s,type:"success",dataUpdatedAt:n?.updatedAt,manual:n?.manual}),s}setState(e){this.#l({type:"setState",state:e})}cancel(e){const n=this.#i?.promise;return this.#i?.cancel(e),n?n.then(Mt).catch(Mt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#e}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>xn(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===gf||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>lr(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!h2(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(n=>n.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#i?.continue()}onOnline(){this.observers.find(n=>n.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#i?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#s.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(n=>n!==e),this.observers.length||(this.#i&&(this.#a||this.#u()?this.#i.cancel({revert:!0}):this.#i.cancelRetry()),this.scheduleGc()),this.#s.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}#u(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"}invalidate(){this.state.isInvalidated||this.#l({type:"invalidate"})}async fetch(e,n){if(this.state.fetchStatus!=="idle"&&this.#i?.status()!=="rejected"){if(this.state.data!==void 0&&n?.cancelRefetch)this.cancel({silent:!0});else if(this.#i)return this.#i.continueRetry(),this.#i.promise}if(e&&this.setOptions(e),!this.options.queryFn){const d=this.observers.find(p=>p.options.queryFn);d&&this.setOptions(d.options)}const s=new AbortController,r=d=>{Object.defineProperty(d,"signal",{enumerable:!0,get:()=>(this.#a=!0,s.signal)})},a=()=>{const d=p2(this.options,n),f=(()=>{const m={client:this.#r,queryKey:this.queryKey,meta:this.meta};return r(m),m})();return this.#a=!1,this.options.persister?this.options.persister(d,f,this):d(f)},c=(()=>{const d={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:this.#r,state:this.state,fetchFn:a};return r(d),d})();(this.#t==="infinite"?u4(this.options.pages):this.options.behavior)?.onFetch(c,this),this.#n=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==c.fetchOptions?.meta)&&this.#l({type:"fetch",meta:c.fetchOptions?.meta}),this.#i=m2({initialPromise:n?.initialPromise,fn:c.fetchFn,onCancel:d=>{d instanceof yp&&d.revert&&this.setState({...this.#n,fetchStatus:"idle"}),s.abort()},onFail:(d,p)=>{this.#l({type:"failed",failureCount:d,error:p})},onPause:()=>{this.#l({type:"pause"})},onContinue:()=>{this.#l({type:"continue"})},retry:c.options.retry,retryDelay:c.options.retryDelay,networkMode:c.options.networkMode,canRun:()=>!0});try{const d=await this.#i.start();if(d===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(d),this.#s.config.onSuccess?.(d,this),this.#s.config.onSettled?.(d,this.state.error,this),d}catch(d){if(d instanceof yp){if(d.silent)return this.#i.promise;if(d.revert){if(this.state.data===void 0)throw d;return this.state.data}}throw this.#l({type:"error",error:d}),this.#s.config.onError?.(d,this),this.#s.config.onSettled?.(this.state.data,d,this),d}finally{this.scheduleGc()}}#l(e){const n=s=>{switch(e.type){case"failed":return{...s,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...s,fetchStatus:"paused"};case"continue":return{...s,fetchStatus:"fetching"};case"fetch":return{...s,...x2(s.data,this.options),fetchMeta:e.meta??null};case"success":const r={...s,...Ig(e.data,e.dataUpdatedAt),dataUpdateCount:s.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?r:void 0,r;case"error":const a=e.error;return{...s,error:a,errorUpdateCount:s.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:s.fetchFailureCount+1,fetchFailureReason:a,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...s,isInvalidated:!0};case"setState":return{...s,...e.state}}};this.state=n(this.state),lt.batch(()=>{this.observers.forEach(s=>{s.onQueryUpdate()}),this.#s.notify({query:this,type:"updated",action:e})})}};function x2(e,n){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:f2(n.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Ig(e,n){return{data:e,dataUpdatedAt:n??Date.now(),error:null,isInvalidated:!1,status:"success"}}function zg(e){const n=typeof e.initialData=="function"?e.initialData():e.initialData,s=n!==void 0,r=s?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:n,dataUpdateCount:0,dataUpdatedAt:s?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:s?"success":"pending",fetchStatus:"idle"}}var yf=class extends Wr{constructor(e,n){super(),this.options=n,this.#t=e,this.#a=null,this.#o=xp(),this.bindMethods(),this.setOptions(n)}#t;#e=void 0;#n=void 0;#s=void 0;#r;#i;#o;#a;#u;#l;#p;#d;#f;#c;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#e.addObserver(this),Mg(this.#e,this.options)?this.#h():this.updateResult(),this.#k())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return kp(this.#e,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return kp(this.#e,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#v(),this.#j(),this.#e.removeObserver(this)}setOptions(e){const n=this.options,s=this.#e;if(this.options=this.#t.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof xn(this.options.enabled,this.#e)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#b(),this.#e.setOptions(this.options),n._defaulted&&!to(this.options,n)&&this.#t.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#e,observer:this});const r=this.hasListeners();r&&Fg(this.#e,s,this.options,n)&&this.#h(),this.updateResult(),r&&(this.#e!==s||xn(this.options.enabled,this.#e)!==xn(n.enabled,this.#e)||lr(this.options.staleTime,this.#e)!==lr(n.staleTime,this.#e))&&this.#g();const a=this.#x();r&&(this.#e!==s||xn(this.options.enabled,this.#e)!==xn(n.enabled,this.#e)||a!==this.#c)&&this.#y(a)}getOptimisticResult(e){const n=this.#t.getQueryCache().build(this.#t,e),s=this.createResult(n,e);return f4(this,s)&&(this.#s=s,this.#i=this.options,this.#r=this.#e.state),s}getCurrentResult(){return this.#s}trackResult(e,n){return new Proxy(e,{get:(s,r)=>(this.trackProp(r),n?.(r),r==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#o.status==="pending"&&this.#o.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(s,r))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#e}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const n=this.#t.defaultQueryOptions(e),s=this.#t.getQueryCache().build(this.#t,n);return s.fetch().then(()=>this.createResult(s,n))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#s))}#h(e){this.#b();let n=this.#e.fetch(this.options,e);return e?.throwOnError||(n=n.catch(Mt)),n}#g(){this.#v();const e=lr(this.options.staleTime,this.#e);if(no.isServer()||this.#s.isStale||!fp(e))return;const s=h2(this.#s.dataUpdatedAt,e)+1;this.#d=Tr.setTimeout(()=>{this.#s.isStale||this.updateResult()},s)}#x(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#e):this.options.refetchInterval)??!1}#y(e){this.#j(),this.#c=e,!(no.isServer()||xn(this.options.enabled,this.#e)===!1||!fp(this.#c)||this.#c===0)&&(this.#f=Tr.setInterval(()=>{(this.options.refetchIntervalInBackground||pf.isFocused())&&this.#h()},this.#c))}#k(){this.#g(),this.#y(this.#x())}#v(){this.#d!==void 0&&(Tr.clearTimeout(this.#d),this.#d=void 0)}#j(){this.#f!==void 0&&(Tr.clearInterval(this.#f),this.#f=void 0)}createResult(e,n){const s=this.#e,r=this.options,a=this.#s,o=this.#r,c=this.#i,d=e!==s?e.state:this.#n,{state:p}=e;let f={...p},m=!1,y;if(n._optimisticResults){const R=this.hasListeners(),B=!R&&Mg(e,n),I=R&&Fg(e,s,n,r);(B||I)&&(f={...f,...x2(p.data,e.options)}),n._optimisticResults==="isRestoring"&&(f.fetchStatus="idle")}let{error:x,errorUpdatedAt:k,status:v}=f;y=f.data;let b=!1;if(n.placeholderData!==void 0&&y===void 0&&v==="pending"){let R;a?.isPlaceholderData&&n.placeholderData===c?.placeholderData?(R=a.data,b=!0):R=typeof n.placeholderData=="function"?n.placeholderData(this.#p?.state.data,this.#p):n.placeholderData,R!==void 0&&(v="success",y=gp(a?.data,R,n),m=!0)}if(n.select&&y!==void 0&&!b)if(a&&y===o?.data&&n.select===this.#u)y=this.#l;else try{this.#u=n.select,y=n.select(y),y=gp(a?.data,y,n),this.#l=y,this.#a=null}catch(R){this.#a=R}this.#a&&(x=this.#a,y=this.#l,k=Date.now(),v="error");const N=f.fetchStatus==="fetching",C=v==="pending",S=v==="error",P=C&&N,M=y!==void 0,F={status:v,fetchStatus:f.fetchStatus,isPending:C,isSuccess:v==="success",isError:S,isInitialLoading:P,isLoading:P,data:y,dataUpdatedAt:f.dataUpdatedAt,error:x,errorUpdatedAt:k,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:f.dataUpdateCount>d.dataUpdateCount||f.errorUpdateCount>d.errorUpdateCount,isFetching:N,isRefetching:N&&!C,isLoadingError:S&&!M,isPaused:f.fetchStatus==="paused",isPlaceholderData:m,isRefetchError:S&&M,isStale:kf(e,n),refetch:this.refetch,promise:this.#o,isEnabled:xn(n.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const R=F.data!==void 0,B=F.status==="error"&&!R,I=Q=>{B?Q.reject(F.error):R&&Q.resolve(F.data)},O=()=>{const Q=this.#o=F.promise=xp();I(Q)},_=this.#o;switch(_.status){case"pending":e.queryHash===s.queryHash&&I(_);break;case"fulfilled":(B||F.data!==_.value)&&O();break;case"rejected":(!B||F.error!==_.reason)&&O();break}}return F}updateResult(){const e=this.#s,n=this.createResult(this.#e,this.options);if(this.#r=this.#e.state,this.#i=this.options,this.#r.data!==void 0&&(this.#p=this.#e),to(n,e))return;this.#s=n;const s=()=>{if(!e)return!0;const{notifyOnChangeProps:r}=this.options,a=typeof r=="function"?r():r;if(a==="all"||!a&&!this.#m.size)return!0;const o=new Set(a??this.#m);return this.options.throwOnError&&o.add("error"),Object.keys(this.#s).some(c=>{const u=c;return this.#s[u]!==e[u]&&o.has(u)})};this.#w({listeners:s()})}#b(){const e=this.#t.getQueryCache().build(this.#t,this.options);if(e===this.#e)return;const n=this.#e;this.#e=e,this.#n=e.state,this.hasListeners()&&(n?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#k()}#w(e){lt.batch(()=>{e.listeners&&this.listeners.forEach(n=>{n(this.#s)}),this.#t.getQueryCache().notify({query:this.#e,type:"observerResultsUpdated"})})}};function p4(e,n){return xn(n.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&xn(n.retryOnMount,e)===!1)}function Mg(e,n){return p4(e,n)||e.state.data!==void 0&&kp(e,n,n.refetchOnMount)}function kp(e,n,s){if(xn(n.enabled,e)!==!1&&lr(n.staleTime,e)!=="static"){const r=typeof s=="function"?s(e):s;return r==="always"||r!==!1&&kf(e,n)}return!1}function Fg(e,n,s,r){return(e!==n||xn(r.enabled,e)===!1)&&(!s.suspense||e.state.status!=="error")&&kf(e,s)}function kf(e,n){return xn(n.enabled,e)!==!1&&e.isStaleByTime(lr(n.staleTime,e))}function f4(e,n){return!to(e.getCurrentResult(),n)}var m4=class extends g2{#t;#e;#n;#s;constructor(e){super(),this.#t=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#e=[],this.state=e.state||y2(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#e.includes(e)||(this.#e.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#e=this.#e.filter(n=>n!==e),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#e.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#s?.continue()??this.execute(this.state.variables)}async execute(e){const n=()=>{this.#r({type:"continue"})},s={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#s=m2({fn:()=>this.options.mutationFn?this.options.mutationFn(e,s):Promise.reject(new Error("No mutationFn found")),onFail:(o,c)=>{this.#r({type:"failed",failureCount:o,error:c})},onPause:()=>{this.#r({type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const r=this.state.status==="pending",a=!this.#s.canStart();try{if(r)n();else{this.#r({type:"pending",variables:e,isPaused:a}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,s);const c=await this.options.onMutate?.(e,s);c!==this.state.context&&this.#r({type:"pending",context:c,variables:e,isPaused:a})}const o=await this.#s.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,s),await this.options.onSuccess?.(o,e,this.state.context,s),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,s),await this.options.onSettled?.(o,null,e,this.state.context,s),this.#r({type:"success",data:o}),o}catch(o){try{await this.#n.config.onError?.(o,e,this.state.context,this,s)}catch(c){Promise.reject(c)}try{await this.options.onError?.(o,e,this.state.context,s)}catch(c){Promise.reject(c)}try{await this.#n.config.onSettled?.(void 0,o,this.state.variables,this.state.context,this,s)}catch(c){Promise.reject(c)}try{await this.options.onSettled?.(void 0,o,e,this.state.context,s)}catch(c){Promise.reject(c)}throw this.#r({type:"error",error:o}),o}finally{this.#n.runNext(this)}}#r(e){const n=s=>{switch(e.type){case"failed":return{...s,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...s,isPaused:!0};case"continue":return{...s,isPaused:!1};case"pending":return{...s,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...s,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...s,data:void 0,error:e.error,failureCount:s.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=n(this.state),lt.batch(()=>{this.#e.forEach(s=>{s.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function y2(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var g4=class extends Wr{constructor(e={}){super(),this.config=e,this.#t=new Set,this.#e=new Map,this.#n=0}#t;#e;#n;build(e,n,s){const r=new m4({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(n),state:s});return this.add(r),r}add(e){this.#t.add(e);const n=Jl(e);if(typeof n=="string"){const s=this.#e.get(n);s?s.push(e):this.#e.set(n,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#t.delete(e)){const n=Jl(e);if(typeof n=="string"){const s=this.#e.get(n);if(s)if(s.length>1){const r=s.indexOf(e);r!==-1&&s.splice(r,1)}else s[0]===e&&this.#e.delete(n)}}this.notify({type:"removed",mutation:e})}canRun(e){const n=Jl(e);if(typeof n=="string"){const r=this.#e.get(n)?.find(a=>a.state.status==="pending");return!r||r===e}else return!0}runNext(e){const n=Jl(e);return typeof n=="string"?this.#e.get(n)?.find(r=>r!==e&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){lt.batch(()=>{this.#t.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#t.clear(),this.#e.clear()})}getAll(){return Array.from(this.#t)}find(e){const n={exact:!0,...e};return this.getAll().find(s=>Tg(n,s))}findAll(e={}){return this.getAll().filter(n=>Tg(e,n))}notify(e){lt.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return lt.batch(()=>Promise.all(e.map(n=>n.continue().catch(Mt))))}};function Jl(e){return e.options.scope?.id}var x4=class extends Wr{#t;#e=void 0;#n;#s;constructor(n,s){super(),this.#t=n,this.setOptions(s),this.bindMethods(),this.#r()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){const s=this.options;this.options=this.#t.defaultMutationOptions(n),to(this.options,s)||this.#t.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),s?.mutationKey&&this.options.mutationKey&&Or(s.mutationKey)!==Or(this.options.mutationKey)?this.reset():this.#n?.state.status==="pending"&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(n){this.#r(),this.#i(n)}getCurrentResult(){return this.#e}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#r(),this.#i()}mutate(n,s){return this.#s=s,this.#n?.removeObserver(this),this.#n=this.#t.getMutationCache().build(this.#t,this.options),this.#n.addObserver(this),this.#n.execute(n)}#r(){const n=this.#n?.state??y2();this.#e={...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset}}#i(n){lt.batch(()=>{if(this.#s&&this.hasListeners()){const s=this.#e.variables,r=this.#e.context,a={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};if(n?.type==="success"){try{this.#s.onSuccess?.(n.data,s,r,a)}catch(o){Promise.reject(o)}try{this.#s.onSettled?.(n.data,null,s,r,a)}catch(o){Promise.reject(o)}}else if(n?.type==="error"){try{this.#s.onError?.(n.error,s,r,a)}catch(o){Promise.reject(o)}try{this.#s.onSettled?.(void 0,n.error,s,r,a)}catch(o){Promise.reject(o)}}}this.listeners.forEach(s=>{s(this.#e)})})}};function Lg(e,n){const s=new Set(n);return e.filter(r=>!s.has(r))}function y4(e,n,s){const r=e.slice(0);return r[n]=s,r}var k4=class extends Wr{#t;#e;#n;#s;#r;#i;#o;#a;#u;#l=[];constructor(e,n,s){super(),this.#t=e,this.#s=s,this.#n=[],this.#r=[],this.#e=[],this.setQueries(n)}onSubscribe(){this.listeners.size===1&&this.#r.forEach(e=>{e.subscribe(n=>{this.#m(e,n)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#r.forEach(e=>{e.destroy()})}setQueries(e,n){this.#n=e,this.#s=n,lt.batch(()=>{const s=this.#r,r=this.#c(this.#n);r.forEach(f=>f.observer.setOptions(f.defaultedQueryOptions));const a=r.map(f=>f.observer),o=a.map(f=>f.getCurrentResult()),c=s.length!==a.length,u=a.some((f,m)=>f!==s[m]),d=c||u,p=d?!0:o.some((f,m)=>{const y=this.#e[m];return!y||!to(f,y)});!d&&!p||(d&&(this.#l=r,this.#r=a),this.#e=o,this.hasListeners()&&(d&&(Lg(s,a).forEach(f=>{f.destroy()}),Lg(a,s).forEach(f=>{f.subscribe(m=>{this.#m(f,m)})})),this.#h()))})}getCurrentResult(){return this.#e}getQueries(){return this.#r.map(e=>e.getCurrentQuery())}getObservers(){return this.#r}getOptimisticResult(e,n){const s=this.#c(e),r=s.map(o=>o.observer.getOptimisticResult(o.defaultedQueryOptions)),a=s.map(o=>o.defaultedQueryOptions.queryHash);return[r,o=>this.#d(o??r,n,a),()=>this.#p(r,s)]}#p(e,n){return n.map((s,r)=>{const a=e[r];return s.defaultedQueryOptions.notifyOnChangeProps?a:s.observer.trackResult(a,o=>{n.forEach(c=>{c.observer.trackProp(o)})})})}#d(e,n,s){if(n){const r=this.#u,a=s!==void 0&&r!==void 0&&(r.length!==s.length||s.some((o,c)=>o!==r[c]));return(!this.#i||this.#e!==this.#a||a||n!==this.#o)&&(this.#o=n,this.#a=this.#e,s!==void 0&&(this.#u=s),this.#i=mf(this.#i,n(e))),this.#i}return e}#f(){return this.#s?.combine!==void 0&&this.#r.some((e,n)=>e.options.suspense&&this.#e[n]?.data===void 0)}#c(e){const n=new Map;this.#r.forEach(r=>{const a=r.options.queryHash;if(!a)return;const o=n.get(a);o?o.push(r):n.set(a,[r])});const s=[];return e.forEach(r=>{const a=this.#t.defaultQueryOptions(r),c=n.get(a.queryHash)?.shift()??new yf(this.#t,a);s.push({defaultedQueryOptions:a,observer:c})}),s}#m(e,n){const s=this.#r.indexOf(e);s!==-1&&(this.#e=y4(this.#e,s,n),this.#h())}#h(){if(this.hasListeners()){const e=this.#p(this.#e,this.#l),n=this.#f(),s=this.#i,r=n?s:this.#d(e,this.#s?.combine);(n||s!==r)&&lt.batch(()=>{this.listeners.forEach(a=>{a(this.#e)})})}}},v4=class extends Wr{constructor(e={}){super(),this.config=e,this.#t=new Map}#t;build(e,n,s){const r=n.queryKey,a=n.queryHash??ff(r,n);let o=this.get(a);return o||(o=new h4({client:e,queryKey:r,queryHash:a,options:e.defaultQueryOptions(n),state:s,defaultOptions:e.getQueryDefaults(r)}),this.add(o)),o}add(e){this.#t.has(e.queryHash)||(this.#t.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const n=this.#t.get(e.queryHash);n&&(e.destroy(),n===e&&this.#t.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){lt.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#t.get(e)}getAll(){return[...this.#t.values()]}find(e){const n={exact:!0,...e};return this.getAll().find(s=>Eg(n,s))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(s=>Eg(e,s)):n}notify(e){lt.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){lt.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){lt.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},j4=class{#t;#e;#n;#s;#r;#i;#o;#a;constructor(e={}){this.#t=e.queryCache||new v4,this.#e=e.mutationCache||new g4,this.#n=e.defaultOptions||{},this.#s=new Map,this.#r=new Map,this.#i=0}mount(){this.#i++,this.#i===1&&(this.#o=pf.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#t.onFocus())}),this.#a=bc.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#t.onOnline())}))}unmount(){this.#i--,this.#i===0&&(this.#o?.(),this.#o=void 0,this.#a?.(),this.#a=void 0)}isFetching(e){return this.#t.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#e.findAll({...e,status:"pending"}).length}getQueryData(e){const n=this.defaultQueryOptions({queryKey:e});return this.#t.get(n.queryHash)?.state.data}ensureQueryData(e){const n=this.defaultQueryOptions(e),s=this.#t.build(this,n),r=s.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&s.isStaleByTime(lr(n.staleTime,s))&&this.prefetchQuery(n),Promise.resolve(r))}getQueriesData(e){return this.#t.findAll(e).map(({queryKey:n,state:s})=>{const r=s.data;return[n,r]})}setQueryData(e,n,s){const r=this.defaultQueryOptions({queryKey:e}),o=this.#t.get(r.queryHash)?.state.data,c=J3(n,o);if(c!==void 0)return this.#t.build(this,r).setData(c,{...s,manual:!0})}setQueriesData(e,n,s){return lt.batch(()=>this.#t.findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,n,s)]))}getQueryState(e){const n=this.defaultQueryOptions({queryKey:e});return this.#t.get(n.queryHash)?.state}removeQueries(e){const n=this.#t;lt.batch(()=>{n.findAll(e).forEach(s=>{n.remove(s)})})}resetQueries(e,n){const s=this.#t;return lt.batch(()=>(s.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},n)))}cancelQueries(e,n={}){const s={revert:!0,...n},r=lt.batch(()=>this.#t.findAll(e).map(a=>a.cancel(s)));return Promise.all(r).then(Mt).catch(Mt)}invalidateQueries(e,n={}){return lt.batch(()=>(this.#t.findAll(e).forEach(s=>{s.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},n)))}refetchQueries(e,n={}){const s={...n,cancelRefetch:n.cancelRefetch??!0},r=lt.batch(()=>this.#t.findAll(e).filter(a=>!a.isDisabled()&&!a.isStatic()).map(a=>{let o=a.fetch(void 0,s);return s.throwOnError||(o=o.catch(Mt)),a.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then(Mt)}fetchQuery(e){const n=this.defaultQueryOptions(e);n.retry===void 0&&(n.retry=!1);const s=this.#t.build(this,n);return s.isStaleByTime(lr(n.staleTime,s))?s.fetch(n):Promise.resolve(s.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Mt).catch(Mt)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Mt).catch(Mt)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return bc.isOnline()?this.#e.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#t}getMutationCache(){return this.#e}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,n){this.#s.set(Or(e),{queryKey:e,defaultOptions:n})}getQueryDefaults(e){const n=[...this.#s.values()],s={};return n.forEach(r=>{eo(e,r.queryKey)&&Object.assign(s,r.defaultOptions)}),s}setMutationDefaults(e,n){this.#r.set(Or(e),{mutationKey:e,defaultOptions:n})}getMutationDefaults(e){const n=[...this.#r.values()],s={};return n.forEach(r=>{eo(e,r.mutationKey)&&Object.assign(s,r.defaultOptions)}),s}defaultQueryOptions(e){if(e._defaulted)return e;const n={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return n.queryHash||(n.queryHash=ff(n.queryKey,n)),n.refetchOnReconnect===void 0&&(n.refetchOnReconnect=n.networkMode!=="always"),n.throwOnError===void 0&&(n.throwOnError=!!n.suspense),!n.networkMode&&n.persister&&(n.networkMode="offlineFirst"),n.queryFn===gf&&(n.enabled=!1),n}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#t.clear(),this.#e.clear()}},k2=$.createContext(void 0),zn=e=>{const n=$.useContext(k2);if(!n)throw new Error("No QueryClient set, use QueryClientProvider to set one");return n},b4=({client:e,children:n})=>($.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),t.jsx(k2.Provider,{value:e,children:n})),v2=$.createContext(!1),j2=()=>$.useContext(v2);v2.Provider;function w4(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var N4=$.createContext(w4()),b2=()=>$.useContext(N4),w2=(e,n,s)=>{const r=s?.state.error&&typeof e.throwOnError=="function"?xf(e.throwOnError,[s.state.error,s]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(n.isReset()||(e.retryOnMount=!1))},N2=e=>{$.useEffect(()=>{e.clearReset()},[e])},S2=({result:e,errorResetBoundary:n,throwOnError:s,query:r,suspense:a})=>e.isError&&!n.isReset()&&!e.isFetching&&r&&(a&&e.data===void 0||xf(s,[e.error,r])),C2=e=>{if(e.suspense){const s=a=>a==="static"?a:Math.max(a??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...a)=>s(r(...a)):s(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},S4=(e,n)=>e.isLoading&&e.isFetching&&!n,vp=(e,n)=>e?.suspense&&n.isPending,jp=(e,n,s)=>n.fetchOptimistic(e).catch(()=>{s.clearReset()});function C4({queries:e,...n},s){const r=zn(),a=j2(),o=b2(),c=$.useMemo(()=>e.map(v=>{const b=r.defaultQueryOptions(v);return b._optimisticResults=a?"isRestoring":"optimistic",b}),[e,r,a]);c.forEach(v=>{C2(v);const b=r.getQueryCache().get(v.queryHash);w2(v,o,b)}),N2(o);const[u]=$.useState(()=>new k4(r,c,n)),[d,p,f]=u.getOptimisticResult(c,n.combine),m=!a&&n.subscribed!==!1;$.useSyncExternalStore($.useCallback(v=>m?u.subscribe(lt.batchCalls(v)):Mt,[u,m]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),$.useEffect(()=>{u.setQueries(c,n)},[c,n,u]);const x=d.some((v,b)=>vp(c[b],v))?d.flatMap((v,b)=>{const N=c[b];if(N&&vp(N,v)){const C=new yf(r,N);return jp(N,C,o)}return[]}):[];if(x.length>0)throw Promise.all(x);const k=d.find((v,b)=>{const N=c[b];return N&&S2({result:v,errorResetBoundary:o,throwOnError:N.throwOnError,query:r.getQueryCache().get(N.queryHash),suspense:N.suspense})});if(k?.error)throw k.error;return p(f())}function $4(e,n,s){const r=j2(),a=b2(),o=zn(),c=o.defaultQueryOptions(e);o.getDefaultOptions().queries?._experimental_beforeQuery?.(c);const u=o.getQueryCache().get(c.queryHash);c._optimisticResults=r?"isRestoring":"optimistic",C2(c),w2(c,a,u),N2(a);const d=!o.getQueryCache().get(c.queryHash),[p]=$.useState(()=>new n(o,c)),f=p.getOptimisticResult(c),m=!r&&e.subscribed!==!1;if($.useSyncExternalStore($.useCallback(y=>{const x=m?p.subscribe(lt.batchCalls(y)):Mt;return p.updateResult(),x},[p,m]),()=>p.getCurrentResult(),()=>p.getCurrentResult()),$.useEffect(()=>{p.setOptions(c)},[c,p]),vp(c,f))throw jp(c,p,a);if(S2({result:f,errorResetBoundary:a,throwOnError:c.throwOnError,query:u,suspense:c.suspense}))throw f.error;return o.getDefaultOptions().queries?._experimental_afterQuery?.(c,f),c.experimental_prefetchInRender&&!no.isServer()&&S4(f,r)&&(d?jp(c,p,a):u?.promise)?.catch(Mt).finally(()=>{p.updateResult()}),c.notifyOnChangeProps?f:p.trackResult(f)}function Pe(e,n){return $4(e,yf)}function $2(e,n){const s=zn(),[r]=$.useState(()=>new x4(s,e));$.useEffect(()=>{r.setOptions(e)},[r,e]);const a=$.useSyncExternalStore($.useCallback(c=>r.subscribe(lt.batchCalls(c)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),o=$.useCallback((c,u)=>{r.mutate(c,u).catch(Mt)},[r]);if(a.error&&xf(r.options.throwOnError,[a.error]))throw a.error;return{...a,mutate:o,mutateAsync:a.mutate}}var Ha=typeof window<"u"?$.useLayoutEffect:$.useEffect;function kh(e){const n=$.useRef({value:e,prev:null}),s=n.current.value;return e!==s&&(n.current={value:e,prev:s}),n.current.prev}function E4(e,n,s={},r={}){$.useEffect(()=>{if(!e.current||r.disabled||typeof IntersectionObserver!="function")return;const a=new IntersectionObserver(([o])=>{n(o)},s);return a.observe(e.current),()=>{a.disconnect()}},[n,s,r.disabled,e])}function T4(e){const n=$.useRef(null);return $.useImperativeHandle(e,()=>n.current,[]),n}const E2=!1;function so(e){return e[e.length-1]}function A4(e){return typeof e=="function"}function sr(e,n){return A4(e)?e(n):e}const T2=Object.prototype.hasOwnProperty,_g=Object.prototype.propertyIsEnumerable;function A2(e){for(const n in e)if(T2.call(e,n))return!0;return!1}const P4=()=>Object.create(null),$r=(e,n)=>rr(e,n,P4);function rr(e,n,s=()=>({}),r=0){if(e===n)return e;if(r>500)return n;const a=n,o=Dg(e)&&Dg(a);if(!o&&!(Ri(e)&&Ri(a)))return a;const c=o?e:Og(e);if(!c)return a;const u=o?a:Og(a);if(!u)return a;const d=c.length,p=u.length,f=o?new Array(p):s();let m=0;for(let y=0;y<p;y++){const x=o?y:u[y],k=e[x],v=a[x];if(k===v){f[x]=k,(o?y<d:T2.call(e,x))&&m++;continue}if(k===null||v===null||typeof k!="object"||typeof v!="object"){f[x]=v;continue}const b=rr(k,v,s,r+1);f[x]=b,b===k&&m++}return d===p&&m===d?e:f}function Og(e){const n=Object.getOwnPropertyNames(e);for(const a of n)if(!_g.call(e,a))return!1;const s=Object.getOwnPropertySymbols(e);if(s.length===0)return n;const r=n;for(const a of s){if(!_g.call(e,a))return!1;r.push(a)}return r}function Ri(e){if(!qg(e))return!1;const n=e.constructor;if(typeof n>"u")return!0;const s=n.prototype;return!(!qg(s)||!s.hasOwnProperty("isPrototypeOf"))}function qg(e){return Object.prototype.toString.call(e)==="[object Object]"}function Dg(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Pr(e,n,s){if(e===n)return!0;if(typeof e!=typeof n)return!1;if(Array.isArray(e)&&Array.isArray(n)){if(e.length!==n.length)return!1;for(let r=0,a=e.length;r<a;r++)if(!Pr(e[r],n[r],s))return!1;return!0}if(Ri(e)&&Ri(n)){const r=s?.ignoreUndefined??!0;if(s?.partial){for(const c in n)if((!r||n[c]!==void 0)&&!Pr(e[c],n[c],s))return!1;return!0}let a=0;if(!r)a=Object.keys(e).length;else for(const c in e)e[c]!==void 0&&a++;let o=0;for(const c in n)if((!r||n[c]!==void 0)&&(o++,o>a||!Pr(e[c],n[c],s)))return!1;return a===o}return!1}function Ii(e){let n,s;const r=new Promise((a,o)=>{n=a,s=o});return r.status="pending",r.resolve=a=>{r.status="resolved",r.value=a,n(a),e?.(a)},r.reject=a=>{r.status="rejected",s(a)},r}function ro(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function R4(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function Bg(e){let n;try{n=decodeURI(e)}catch{n=e.replaceAll(/%[0-9A-F]{2}/gi,s=>{try{return decodeURI(s)}catch{return s}})}return R4(n)}const I4=["http:","https:","mailto:","tel:"];function wc(e,n){if(!e)return!1;try{const s=new URL(e);return!n.has(s.protocol)}catch{return!1}}function Fa(e){if(!e)return{path:e,handledProtocolRelativeURL:!1};if(!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith("//"))return{path:e,handledProtocolRelativeURL:!1};const n=/%25|%5C/gi;let s=0,r="",a;for(;(a=n.exec(e))!==null;)r+=Bg(e.slice(s,a.index))+a[0],s=n.lastIndex;r=r+Bg(s?e.slice(s):e);let o=!1;return r.startsWith("//")&&(o=!0,r="/"+r.replace(/^\/+/,"")),{path:r,handledProtocolRelativeURL:o}}function z4(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function M4(e,n){if(e===n)return!0;if(e.length!==n.length)return!1;for(let s=0;s<e.length;s++)if(e[s]!==n[s])return!1;return!0}function Ss(){throw new Error("Invariant failed")}function io(e){const n=new Map;let s,r;const a=o=>{o.next&&(o.prev?(o.prev.next=o.next,o.next.prev=o.prev,o.next=void 0,r&&(r.next=o,o.prev=r)):(o.next.prev=void 0,s=o.next,o.next=void 0,r&&(o.prev=r,r.next=o)),r=o)};return{get(o){const c=n.get(o);if(c)return a(c),c.value},set(o,c){if(n.size>=e&&s){const d=s;n.delete(d.key),d.next&&(s=d.next,d.next.prev=void 0),d===r&&(r=void 0)}const u=n.get(o);if(u)u.value=c,a(u);else{const d={key:o,value:c,prev:r};r&&(r.next=d),r=d,s||(s=d),n.set(o,d)}},clear(){n.clear(),s=void 0,r=void 0}}}const ir=4,P2=5;function F4(e){const n=e.indexOf("{");if(n===-1)return null;const s=e.indexOf("}",n);return s===-1||n+1>=e.length?null:[n,s]}function R2(e,n,s=new Uint16Array(6)){const r=e.indexOf("/",n),a=r===-1?e.length:r,o=e.substring(n,a);if(!o||!o.includes("$"))return s[0]=0,s[1]=n,s[2]=n,s[3]=a,s[4]=a,s[5]=a,s;if(o==="$"){const u=e.length;return s[0]=2,s[1]=n,s[2]=n,s[3]=u,s[4]=u,s[5]=u,s}if(o.charCodeAt(0)===36)return s[0]=1,s[1]=n,s[2]=n+1,s[3]=a,s[4]=a,s[5]=a,s;const c=F4(o);if(c){const[u,d]=c,p=o.charCodeAt(u+1);if(p===45){if(u+2<o.length&&o.charCodeAt(u+2)===36){const f=u+3,m=d;if(f<m)return s[0]=3,s[1]=n+u,s[2]=n+f,s[3]=n+m,s[4]=n+d+1,s[5]=a,s}}else if(p===36){const f=u+1,m=u+2;return m===d?(s[0]=2,s[1]=n+u,s[2]=n+f,s[3]=n+m,s[4]=n+d+1,s[5]=e.length,s):(s[0]=1,s[1]=n+u,s[2]=n+m,s[3]=n+d,s[4]=n+d+1,s[5]=a,s)}}return s[0]=0,s[1]=n,s[2]=n,s[3]=a,s[4]=a,s[5]=a,s}function tu(e,n,s,r,a,o,c){c?.(s);let u=r;{const d=s.fullPath??s.from,p=d.length,f=s.options?.caseSensitive??e,m=s.options?.params?.parse??s.options?.parseParams;for(;u<p;){const x=R2(d,u,n);let k;const v=u,b=x[5];switch(u=b+1,o++,x[0]){case 0:{const N=d.substring(x[2],x[3]);if(f){const C=a.static?.get(N);if(C)k=C;else{a.static??=new Map;const S=Ar(s.fullPath??s.from);S.parent=a,S.depth=o,k=S,a.static.set(N,S)}}else{const C=N.toLowerCase(),S=a.staticInsensitive?.get(C);if(S)k=S;else{a.staticInsensitive??=new Map;const P=Ar(s.fullPath??s.from);P.parent=a,P.depth=o,k=P,a.staticInsensitive.set(C,P)}}break}case 1:{const N=d.substring(v,x[1]),C=d.substring(x[4],b),S=f&&!!(N||C),P=N?S?N:N.toLowerCase():void 0,M=C?S?C:C.toLowerCase():void 0,T=!m&&a.dynamic?.find(F=>!F.parse&&F.caseSensitive===S&&F.prefix===P&&F.suffix===M);if(T)k=T;else{const F=jh(1,s.fullPath??s.from,S,P,M);k=F,F.depth=o,F.parent=a,a.dynamic??=[],a.dynamic.push(F)}break}case 3:{const N=d.substring(v,x[1]),C=d.substring(x[4],b),S=f&&!!(N||C),P=N?S?N:N.toLowerCase():void 0,M=C?S?C:C.toLowerCase():void 0,T=!m&&a.optional?.find(F=>!F.parse&&F.caseSensitive===S&&F.prefix===P&&F.suffix===M);if(T)k=T;else{const F=jh(3,s.fullPath??s.from,S,P,M);k=F,F.parent=a,F.depth=o,a.optional??=[],a.optional.push(F)}break}case 2:{const N=d.substring(v,x[1]),C=d.substring(x[4],b),S=f&&!!(N||C),P=N?S?N:N.toLowerCase():void 0,M=C?S?C:C.toLowerCase():void 0,T=jh(2,s.fullPath??s.from,S,P,M);k=T,T.parent=a,T.depth=o,a.wildcard??=[],a.wildcard.push(T)}}a=k}if(m&&s.children&&!s.isRoot&&s.id&&s.id.charCodeAt(s.id.lastIndexOf("/")+1)===95){const x=Ar(s.fullPath??s.from);x.kind=P2,x.parent=a,o++,x.depth=o,a.pathless??=[],a.pathless.push(x),a=x}const y=(s.path||!s.children)&&!s.isRoot;if(y&&d.endsWith("/")){const x=Ar(s.fullPath??s.from);x.kind=ir,x.parent=a,o++,x.depth=o,a.index=x,a=x}a.parse=m??null,y&&!a.route&&(a.route=s,a.fullPath=s.fullPath??s.from)}if(s.children)for(const d of s.children)tu(e,n,d,u,a,o,c)}function vh(e,n){if(e.parse&&!n.parse)return-1;if(!e.parse&&n.parse)return 1;if(e.prefix&&n.prefix&&e.prefix!==n.prefix){if(e.prefix.startsWith(n.prefix))return-1;if(n.prefix.startsWith(e.prefix))return 1}if(e.suffix&&n.suffix&&e.suffix!==n.suffix){if(e.suffix.endsWith(n.suffix))return-1;if(n.suffix.endsWith(e.suffix))return 1}return e.prefix&&!n.prefix?-1:!e.prefix&&n.prefix?1:e.suffix&&!n.suffix?-1:!e.suffix&&n.suffix?1:e.caseSensitive&&!n.caseSensitive?-1:!e.caseSensitive&&n.caseSensitive?1:0}function nr(e){if(e.pathless)for(const n of e.pathless)nr(n);if(e.static)for(const n of e.static.values())nr(n);if(e.staticInsensitive)for(const n of e.staticInsensitive.values())nr(n);if(e.dynamic?.length){e.dynamic.sort(vh);for(const n of e.dynamic)nr(n)}if(e.optional?.length){e.optional.sort(vh);for(const n of e.optional)nr(n)}if(e.wildcard?.length){e.wildcard.sort(vh);for(const n of e.wildcard)nr(n)}}function Ar(e){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null}}function jh(e,n,s,r,a){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:n,parent:null,parse:null,caseSensitive:s,prefix:r,suffix:a}}function L4(e,n){const s=Ar("/"),r=new Uint16Array(6);for(const a of e)tu(!1,r,a,1,s,0);nr(s),n.masksTree=s,n.flatCache=io(1e3)}function _4(e,n){e||="/";const s=n.flatCache.get(e);if(s)return s;const r=vf(e,n.masksTree);return n.flatCache.set(e,r),r}function O4(e,n,s,r,a){e||="/",r||="/";const o=n?`case\0${e}`:e;let c=a.singleCache.get(o);return c||(c=Ar("/"),tu(n,new Uint16Array(6),{from:e},1,c,0),a.singleCache.set(o,c)),vf(r,c,s)}function q4(e,n,s=!1){const r=s?e:`nofuzz\0${e}`,a=n.matchCache.get(r);if(a!==void 0)return a;e||="/";let o;try{o=vf(e,n.segmentTree,s)}catch(c){if(c instanceof URIError)o=null;else throw c}return o&&(o.branch=z2(o.route)),n.matchCache.set(r,o),o}function D4(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function B4(e,n=!1,s){const r=Ar(e.fullPath),a=new Uint16Array(6),o={},c={};let u=0;return tu(n,a,e,1,r,0,d=>{if(s?.(d,u),d.id in o&&Ss(),o[d.id]=d,u!==0&&d.path){const p=D4(d.fullPath);(!c[p]||d.fullPath.endsWith("/"))&&(c[p]=d)}u++}),nr(r),{processedTree:{segmentTree:r,singleCache:io(1e3),matchCache:io(1e3),flatCache:null,masksTree:null},routesById:o,routesByPath:c}}function vf(e,n,s=!1){const r=e.split("/"),a=U4(e,r,n,s);if(!a)return null;const[o]=I2(e,r,a);return{route:a.node.route,rawParams:o}}function I2(e,n,s){const r=W4(s.node);let a=null;const o=Object.create(null);let c=s.extract?.part??0,u=s.extract?.node??0,d=s.extract?.path??0,p=s.extract?.segment??0;for(;u<r.length;c++,u++,d++,p++){const f=r[u];if(f.kind===ir)break;if(f.kind===P2){p--,c--,d--;continue}const m=n[c],y=d;if(m&&(d+=m.length),f.kind===1){a??=s.node.fullPath.split("/");const x=a[p],k=f.prefix?.length??0;if(x.charCodeAt(k)===123){const v=f.suffix?.length??0,b=x.substring(k+2,x.length-v-1),N=m.substring(k,m.length-v);o[b]=decodeURIComponent(N)}else{const v=x.substring(1);o[v]=decodeURIComponent(m)}}else if(f.kind===3){if(s.skipped&1<<u){c--,d=y-1;continue}a??=s.node.fullPath.split("/");const x=a[p],k=f.prefix?.length??0,v=f.suffix?.length??0,b=x.substring(k+3,x.length-v-1),N=f.suffix||f.prefix?m.substring(k,m.length-v):m;N&&(o[b]=decodeURIComponent(N))}else if(f.kind===2){const x=f,k=e.substring(y+(x.prefix?.length??0),e.length-(x.suffix?.length??0)),v=decodeURIComponent(k);o["*"]=v,o._splat=v;break}}return s.rawParams&&Object.assign(o,s.rawParams),[o,{part:c,node:u,path:d,segment:p}]}function z2(e){const n=[e];for(;e.parentRoute;)e=e.parentRoute,n.push(e);return n.reverse(),n}function W4(e){const n=Array(e.depth+1);do n[e.depth]=e,e=e.parent;while(e);return n}function U4(e,n,s,r){if(e==="/"&&s.index)return{node:s.index,skipped:0};const a=!so(n),o=a&&e!=="/",c=n.length-(a?1:0),u=[{node:s,index:1,skipped:0,depth:1,statics:0,dynamics:0,optionals:0}];let d=null,p=null;for(;u.length;){const f=u.pop(),{node:m,index:y,skipped:x,depth:k,statics:v,dynamics:b,optionals:N}=f;let{extract:C,rawParams:S}=f;if(m.kind===2&&m.route&&!tc(p,f))continue;if(m.parse){if(!Wg(e,n,f))continue;S=f.rawParams,C=f.extract}r&&m.route&&m.kind!==ir&&tc(d,f)&&(d=f);const P=y===c;if(P&&(m.route&&(!o||m.kind===ir||m.kind===2)&&tc(p,f)&&(p=f),!m.optional&&!m.wildcard&&!m.index&&!m.pathless))continue;const M=P?void 0:n[y];let T;if(P&&m.index){const F={node:m.index,index:y,skipped:x,depth:k+1,statics:v,dynamics:b,optionals:N,extract:C,rawParams:S};let R=!0;if(m.index.parse&&(Wg(e,n,F)||(R=!1)),R){if(!b&&!N&&!x&&H4(v,c))return F;tc(p,F)&&(p=F)}}if(m.wildcard)for(let F=m.wildcard.length-1;F>=0;F--){const R=m.wildcard[F],{prefix:B,suffix:I}=R;if(!(B&&(P||!(R.caseSensitive?M:T??=M.toLowerCase()).startsWith(B)))){if(I){if(P)continue;const O=n.slice(y).join("/").slice(-I.length);if((R.caseSensitive?O:O.toLowerCase())!==I)continue}u.push({node:R,index:c,skipped:x,depth:k+1,statics:v,dynamics:b,optionals:N,extract:C,rawParams:S})}}if(m.optional){const F=x|1<<k,R=k+1;for(let B=m.optional.length-1;B>=0;B--){const I=m.optional[B];u.push({node:I,index:y,skipped:F,depth:R,statics:v,dynamics:b,optionals:N,extract:C,rawParams:S})}if(!P)for(let B=m.optional.length-1;B>=0;B--){const I=m.optional[B],{prefix:O,suffix:_}=I;if(O||_){const Q=I.caseSensitive?M:T??=M.toLowerCase();if(O&&!Q.startsWith(O)||_&&!Q.endsWith(_))continue}u.push({node:I,index:y+1,skipped:x,depth:R,statics:v,dynamics:b,optionals:N+ec(c,y),extract:C,rawParams:S})}}if(!P&&m.dynamic&&M)for(let F=m.dynamic.length-1;F>=0;F--){const R=m.dynamic[F],{prefix:B,suffix:I}=R;if(B||I){const O=R.caseSensitive?M:T??=M.toLowerCase();if(B&&!O.startsWith(B)||I&&!O.endsWith(I))continue}u.push({node:R,index:y+1,skipped:x,depth:k+1,statics:v,dynamics:b+ec(c,y),optionals:N,extract:C,rawParams:S})}if(!P&&m.staticInsensitive){const F=m.staticInsensitive.get(T??=M.toLowerCase());F&&u.push({node:F,index:y+1,skipped:x,depth:k+1,statics:v+ec(c,y),dynamics:b,optionals:N,extract:C,rawParams:S})}if(!P&&m.static){const F=m.static.get(M);F&&u.push({node:F,index:y+1,skipped:x,depth:k+1,statics:v+ec(c,y),dynamics:b,optionals:N,extract:C,rawParams:S})}if(m.pathless){const F=k+1;for(let R=m.pathless.length-1;R>=0;R--){const B=m.pathless[R];u.push({node:B,index:y,skipped:x,depth:F,statics:v,dynamics:b,optionals:N,extract:C,rawParams:S})}}}if(p)return p;if(r&&d){let f=d.index;for(let y=0;y<d.index;y++)f+=n[y].length;const m=f===e.length?"/":e.slice(f);return d.rawParams??=Object.create(null),d.rawParams["**"]=decodeURIComponent(m),d}return null}function ec(e,n){return 2**(e-n-1)}function H4(e,n){return e===2**(n-1)-1}function Wg(e,n,s){let r,a;try{[r,a]=I2(e,n,s)}catch{return null}if(s.rawParams=r,s.extract=a,!s.node.parse)return!0;try{if(s.node.parse(r)===!1)return null}catch{}return!0}function tc(e,n){return e?n.statics>e.statics||n.statics===e.statics&&(n.dynamics>e.dynamics||n.dynamics===e.dynamics&&(n.optionals>e.optionals||n.optionals===e.optionals&&((n.node.kind===ir)>(e.node.kind===ir)||n.node.kind===ir==(e.node.kind===ir)&&n.depth>e.depth))):!0}function gc(e){return jf(e.filter(n=>n!==void 0).join("/"))}function jf(e){return e.replace(/\/{2,}/g,"/")}function M2(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function Ns(e){const n=e.length;return n>1&&e[n-1]==="/"?e.replace(/\/{1,}$/,""):e}function F2(e){return Ns(M2(e))}function Nc(e,n){return e?.endsWith("/")&&e!=="/"&&e!==`${n}/`?e.slice(0,-1):e}function V4(e,n,s){return Nc(e,s)===Nc(n,s)}function K4({base:e,to:n,trailingSlash:s="never",cache:r}){const a=n.startsWith("/"),o=!a&&n===".";let c;if(r){c=a?n:o?e:e+"\0"+n;const p=r.get(c);if(p)return p}let u;if(o)u=e.split("/");else if(a)u=n.split("/");else{for(u=e.split("/");u.length>1&&so(u)==="";)u.pop();const p=n.split("/");for(let f=0,m=p.length;f<m;f++){const y=p[f];y===""?f?f===m-1&&u.push(y):u=[y]:y===".."?u.pop():y==="."||u.push(y)}}u.length>1&&(so(u)===""?s==="never"&&u.pop():s==="always"&&u.push(""));const d=jf(u.join("/"))||"/";return c&&r&&r.set(c,d),d}function Y4(e){const n=new Map(e.map(a=>[encodeURIComponent(a),a])),s=Array.from(n.keys()).map(a=>a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),r=new RegExp(s,"g");return a=>a.replace(r,o=>n.get(o)??o)}function bh(e,n,s){const r=n[e];return typeof r!="string"?r:e==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split("/").map(a=>Hg(a,s)).join("/"):Hg(r,s)}function Ug({path:e,params:n,decoder:s,...r}){let a=!1;const o=Object.create(null);if(!e||e==="/")return{interpolatedPath:"/",usedParams:o,isMissingParams:a};if(!e.includes("$"))return{interpolatedPath:e,usedParams:o,isMissingParams:a};const c=e.length;let u=0,d,p="";for(;u<c;){const f=u;d=R2(e,f,d);const m=d[5];if(u=m+1,f===m)continue;const y=d[0];if(y===0){p+="/"+e.substring(f,m);continue}if(y===2){const x=n._splat;o._splat=x,o["*"]=x;const k=e.substring(f,d[1]),v=e.substring(d[4],m);if(!x){a=!0,(k||v)&&(p+="/"+k+v);continue}const b=bh("_splat",n,s);p+="/"+k+b+v;continue}if(y===1){const x=e.substring(d[2],d[3]);!a&&!(x in n)&&(a=!0),o[x]=n[x];const k=e.substring(f,d[1]),v=e.substring(d[4],m),b=bh(x,n,s)??"undefined";p+="/"+k+b+v;continue}if(y===3){const x=e.substring(d[2],d[3]),k=n[x];if(k==null)continue;o[x]=k;const v=e.substring(f,d[1]),b=e.substring(d[4],m),N=bh(x,n,s)??"";p+="/"+v+N+b;continue}}return e.endsWith("/")&&(p+="/"),{usedParams:o,interpolatedPath:p||"/",isMissingParams:a}}function Hg(e,n){const s=encodeURIComponent(e);return n?.(s)??s}function Lt(e){return e?.isNotFound===!0}function Q4(){try{return typeof window<"u"&&typeof window.sessionStorage=="object"?window.sessionStorage:void 0}catch{return}}const G4="tsr-scroll-restoration-v1_3";function Z4(){const e=Q4();if(!e)return null;let n={};try{const r=JSON.parse(e.getItem("tsr-scroll-restoration-v1_3")||"{}");Ri(r)&&(n=r)}catch{}return{get state(){return n},set:r=>{n=sr(r,n)||n},persist:()=>{try{e.setItem(G4,JSON.stringify(n))}catch{}}}}const Vg=Z4(),X4=e=>e.state.__TSR_key||e.href;function J4(e){const n=[];let s;for(;s=e.parentNode;)n.push(`${e.tagName}:nth-child(${Array.prototype.indexOf.call(s.children,e)+1})`),e=s;return`${n.reverse().join(" > ")}`.toLowerCase()}let nc=!1;const La="window",Kg="data-scroll-restoration-id";function e5(e,n){if(!Vg)return;const s=Vg;if((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!s)return;e.isScrollRestorationSetup=!0,nc=!1;const r=e.options.getScrollRestorationKey||X4,a=new Map;window.history.scrollRestoration="manual";const o=u=>{if(!(nc||!e.isScrollRestoring))if(u.target===document||u.target===window)a.set(La,{scrollX:window.scrollX||0,scrollY:window.scrollY||0});else{const d=u.target;a.set(d,{scrollX:d.scrollLeft||0,scrollY:d.scrollTop||0})}},c=u=>{if(!e.isScrollRestoring||!u||a.size===0||!s)return;const d=s.state[u]||={};for(const[p,f]of a){let m;if(p===La)m=La;else if(p.isConnected){const y=p.getAttribute(Kg);m=y?`[${Kg}="${y}"]`:J4(p)}m&&(d[m]=f)}};document.addEventListener("scroll",o,!0),e.subscribe("onBeforeLoad",u=>{c(u.fromLocation?r(u.fromLocation):void 0),a.clear()}),window.addEventListener("pagehide",()=>{c(r(e.stores.resolvedLocation.get()??e.stores.location.get())),s.persist()}),e.subscribe("onRendered",u=>{const d=r(u.toLocation),p=e.options.scrollRestorationBehavior,f=e.options.scrollToTopSelectors;if(a.clear(),!e.resetNextScroll){e.resetNextScroll=!0;return}if(!(typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation}))){nc=!0;try{const m=e.isScrollRestoring?s.state[d]:void 0;let y=!1;if(m)for(const x in m){const k=m[x];if(!Ri(k))continue;const{scrollX:v,scrollY:b}=k;if(!(!Number.isFinite(v)||!Number.isFinite(b))){if(x===La)window.scrollTo({top:b,left:v,behavior:p}),y=!0;else if(x){let N;try{N=document.querySelector(x)}catch{continue}N&&(N.scrollLeft=v,N.scrollTop=b,y=!0)}}}if(!y){const x=e.history.location.hash.slice(1);if(x){const k=window.history.state?.__hashScrollIntoViewOptions??!0;if(k){const v=document.getElementById(x);v&&v.scrollIntoView(k)}}else{const k={top:0,left:0,behavior:p};if(window.scrollTo(k),f)for(const v of f){if(v===La)continue;const b=typeof v=="function"?v():document.querySelector(v);b&&b.scrollTo(k)}}}}finally{nc=!1}e.isScrollRestoring&&s.set(m=>(m[d]||={},m))}})}function t5(e,n=String){const s=new URLSearchParams;for(const r in e){const a=e[r];a!==void 0&&s.set(r,n(a))}return s.toString()}function wh(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function n5(e){const n=new URLSearchParams(e),s=Object.create(null);for(const[r,a]of n.entries()){const o=s[r];o==null?s[r]=wh(a):Array.isArray(o)?o.push(wh(a)):s[r]=[o,wh(a)]}return s}const s5=i5(JSON.parse),r5=a5(JSON.stringify,JSON.parse);function i5(e){return n=>{n[0]==="?"&&(n=n.substring(1));const s=n5(n);for(const r in s){const a=s[r];if(typeof a=="string")try{s[r]=e(a)}catch{}}return s}}function a5(e,n){const s=typeof n=="function";function r(a){if(typeof a=="object"&&a!==null)try{return e(a)}catch{}else if(s&&typeof a=="string")try{return n(a),e(a)}catch{}return a}return a=>{const o=t5(a,r);return o?`?${o}`:""}}const Rr="__root__";function nu(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&!e.reloadDocument&&typeof e.href=="string")try{new URL(e.href),e.reloadDocument=!0}catch{}const n=new Headers(e.headers);e.href&&n.get("Location")===null&&n.set("Location",e.href);const s=new Response(null,{status:e.statusCode,headers:n});if(s.options=e,e.throw)throw s;return s}function en(e){return e instanceof Response&&!!e.options}function o5(e){return{input:({url:n})=>{for(const s of e)n=bp(s,n);return n},output:({url:n})=>{for(let s=e.length-1;s>=0;s--)n=L2(e[s],n);return n}}}function l5(e){const n=F2(e.basepath),s=`/${n}`,r=`${s}/`,a=e.caseSensitive?s:s.toLowerCase(),o=e.caseSensitive?r:r.toLowerCase();return{input:({url:c})=>{const u=e.caseSensitive?c.pathname:c.pathname.toLowerCase();return u===a?c.pathname="/":u.startsWith(o)&&(c.pathname=c.pathname.slice(s.length)),c},output:({url:c})=>(c.pathname=gc(["/",n,c.pathname]),c)}}function bp(e,n){const s=e?.input?.({url:n});if(s){if(typeof s=="string")return new URL(s);if(s instanceof URL)return s}return n}function L2(e,n){const s=e?.output?.({url:n});if(s){if(typeof s=="string")return new URL(s);if(s instanceof URL)return s}return n}function c5(e,n){const{createMutableStore:s,createReadonlyStore:r,batch:a,init:o}=n,c=new Map,u=new Map,d=new Map,p=s(e.status),f=s(e.loadedAt),m=s(e.isLoading),y=s(e.isTransitioning),x=s(e.location),k=s(e.resolvedLocation),v=s(e.statusCode),b=s(e.redirect),N=s([]),C=s([]),S=s([]),P=r(()=>Nh(c,N.get())),M=r(()=>Nh(u,C.get())),T=r(()=>Nh(d,S.get())),F=r(()=>N.get()[0]),R=r(()=>N.get().some(H=>c.get(H)?.get().status==="pending")),B=r(()=>({locationHref:x.get().href,resolvedLocationHref:k.get()?.href,status:p.get()})),I=r(()=>({status:p.get(),loadedAt:f.get(),isLoading:m.get(),isTransitioning:y.get(),matches:P.get(),location:x.get(),resolvedLocation:k.get(),statusCode:v.get(),redirect:b.get()})),O=io(64);function _(H){let V=O.get(H);return V||(V=r(()=>{const ne=N.get();for(const A of ne){const D=c.get(A);if(D&&D.routeId===H)return D.get()}}),O.set(H,V)),V}const Q={status:p,loadedAt:f,isLoading:m,isTransitioning:y,location:x,resolvedLocation:k,statusCode:v,redirect:b,matchesId:N,pendingIds:C,cachedIds:S,matches:P,pendingMatches:M,cachedMatches:T,firstId:F,hasPending:R,matchRouteDeps:B,matchStores:c,pendingMatchStores:u,cachedMatchStores:d,__store:I,getRouteMatchStore:_,setMatches:q,setPending:K,setCached:ce};q(e.matches),o?.(Q);function q(H){Sh(H,c,N,s,a)}function K(H){Sh(H,u,C,s,a)}function ce(H){Sh(H,d,S,s,a)}return Q}function Nh(e,n){const s=[];for(const r of n){const a=e.get(r);a&&s.push(a.get())}return s}function Sh(e,n,s,r,a){const o=e.map(u=>u.id),c=new Set(o);a(()=>{for(const u of n.keys())c.has(u)||n.delete(u);for(const u of e){const d=n.get(u.id);if(!d){const p=r(u);p.routeId=u.routeId,n.set(u.id,p);continue}d.routeId=u.routeId,d.get()!==u&&d.set(u)}M4(s.get(),o)||s.set(o)})}const wp=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},u5=e=>e.stores.matchesId.get().some(n=>e.stores.matchStores.get(n)?.get()._forcePending),su=(e,n)=>!!(e.preload&&!e.router.stores.matchStores.has(n)),Ir=(e,n,s=!0)=>{const r={...e.router.options.context??{}},a=s?n:n-1;for(let o=0;o<=a;o++){const c=e.matches[o];if(!c)continue;const u=e.router.getMatch(c.id);u&&Object.assign(r,u.__routeContext,u.__beforeLoadContext)}return r},Yg=(e,n)=>{if(!e.matches.length)return;const s=n.routeId,r=e.matches.findIndex(c=>c.routeId===e.router.routeTree.id),a=r>=0?r:0;let o=s?e.matches.findIndex(c=>c.routeId===s):e.firstBadMatchIndex??e.matches.length-1;o<0&&(o=a);for(let c=o;c>=0;c--){const u=e.matches[c];if(e.router.looseRoutesById[u.routeId].options.notFoundComponent)return c}return s?o:a},ar=(e,n,s)=>{if(!(!en(s)&&!Lt(s)))throw en(s)&&s.redirectHandled&&!s.options.reloadDocument||(n&&(n._nonReactive.beforeLoadPromise?.resolve(),n._nonReactive.loaderPromise?.resolve(),n._nonReactive.beforeLoadPromise=void 0,n._nonReactive.loaderPromise=void 0,n._nonReactive.error=s,e.updateMatch(n.id,r=>({...r,status:en(s)?"redirected":Lt(s)?"notFound":r.status==="pending"?"success":r.status,context:Ir(e,n.index),isFetching:!1,error:s})),Lt(s)&&!s.routeId&&(s.routeId=n.routeId),n._nonReactive.loadPromise?.resolve()),en(s)&&(e.rendered=!0,s.options._fromLocation=e.location,s.redirectHandled=!0,s=e.router.resolveRedirect(s))),s},_2=(e,n)=>{const s=e.router.getMatch(n);return!!(!s||s._nonReactive.dehydrated)},Qg=(e,n,s)=>{const r=Ir(e,s);e.updateMatch(n,a=>({...a,context:r}))},_a=(e,n,s,r)=>{const{id:a,routeId:o}=e.matches[n],c=e.router.looseRoutesById[o];if(s instanceof Promise)throw s;s.routerCode=r,e.firstBadMatchIndex??=n,ar(e,e.router.getMatch(a),s);try{c.options.onError?.(s)}catch(u){s=u,ar(e,e.router.getMatch(a),s)}e.updateMatch(a,u=>(u._nonReactive.beforeLoadPromise?.resolve(),u._nonReactive.beforeLoadPromise=void 0,u._nonReactive.loadPromise?.resolve(),{...u,error:s,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController})),!e.preload&&!en(s)&&!Lt(s)&&(e.serialError??=s)},O2=(e,n,s,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;const a=s.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!su(e,n)&&(s.options.loader||s.options.beforeLoad||D2(s))&&typeof a=="number"&&a!==1/0&&(s.options.pendingComponent??e.router.options?.defaultPendingComponent)){const o=setTimeout(()=>{wp(e)},a);r._nonReactive.pendingTimeout=o}},d5=(e,n,s)=>{const r=e.router.getMatch(n);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;O2(e,n,s,r);const a=()=>{const o=e.router.getMatch(n);o.preload&&(o.status==="redirected"||o.status==="notFound")&&ar(e,o,o.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(a):a()},h5=(e,n,s,r)=>{const a=e.router.getMatch(n);let o=a._nonReactive.loadPromise;a._nonReactive.loadPromise=Ii(()=>{o?.resolve(),o=void 0});const{paramsError:c,searchError:u}=a;c&&_a(e,s,c,"PARSE_PARAMS"),u&&_a(e,s,u,"VALIDATE_SEARCH"),O2(e,n,r,a);const d=new AbortController;let p=!1;const f=()=>{p||(p=!0,e.updateMatch(n,P=>({...P,isFetching:"beforeLoad",fetchCount:P.fetchCount+1,abortController:d})))},m=()=>{a._nonReactive.beforeLoadPromise?.resolve(),a._nonReactive.beforeLoadPromise=void 0,e.updateMatch(n,P=>({...P,isFetching:!1}))};if(!r.options.beforeLoad){e.router.batch(()=>{f(),m()});return}a._nonReactive.beforeLoadPromise=Ii();const y={...Ir(e,s,!1),...a.__routeContext},{search:x,params:k,cause:v}=a,b=su(e,n),N={search:x,abortController:d,params:k,preload:b,context:y,location:e.location,navigate:P=>e.router.navigate({...P,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:b?"preload":v,matches:e.matches,routeId:r.id,...e.router.options.additionalContext},C=P=>{if(P===void 0){e.router.batch(()=>{f(),m()});return}(en(P)||Lt(P))&&(f(),_a(e,s,P,"BEFORE_LOAD")),e.router.batch(()=>{f(),e.updateMatch(n,M=>({...M,__beforeLoadContext:P})),m()})};let S;try{if(S=r.options.beforeLoad(N),ro(S))return f(),S.catch(P=>{_a(e,s,P,"BEFORE_LOAD")}).then(C)}catch(P){f(),_a(e,s,P,"BEFORE_LOAD")}C(S)},p5=(e,n)=>{const{id:s,routeId:r}=e.matches[n],a=e.router.looseRoutesById[r],o=()=>u(),c=()=>h5(e,s,n,a),u=()=>{if(_2(e,s))return;const d=d5(e,s,a);return ro(d)?d.then(c):c()};return o()},f5=(e,n,s)=>{const r=e.router.getMatch(n);if(!r||!s.options.head&&!s.options.scripts&&!s.options.headers)return;const a={ssr:e.router.options.ssr,matches:e.matches,match:r,params:r.params,loaderData:r.loaderData};return Promise.all([s.options.head?.(a),s.options.scripts?.(a),s.options.headers?.(a)]).then(([o,c,u])=>({meta:o?.meta,links:o?.links,headScripts:o?.scripts,headers:u,scripts:c,styles:o?.styles}))},q2=(e,n,s,r,a)=>{const o=n[r-1],{params:c,loaderDeps:u,abortController:d,cause:p}=e.router.getMatch(s),f=Ir(e,r),m=su(e,s);return{params:c,deps:u,preload:!!m,parentMatchPromise:o,abortController:d,context:f,location:e.location,navigate:y=>e.router.navigate({...y,_fromLocation:e.location}),cause:m?"preload":p,route:a,...e.router.options.additionalContext}},Gg=async(e,n,s,r,a)=>{try{const o=e.router.getMatch(s);try{(!(E2??e.router.isServer)||o.ssr===!0)&&ao(a);const c=a.options.loader,u=typeof c=="function"?c:c?.handler,d=u?.(q2(e,n,s,r,a)),p=!!u&&ro(d);if((p||a._lazyPromise||a._componentsPromise||a.options.head||a.options.scripts||a.options.headers||o._nonReactive.minPendingPromise)&&e.updateMatch(s,m=>({...m,isFetching:"loader"})),u){const m=p?await d:d;ar(e,e.router.getMatch(s),m),m!==void 0&&e.updateMatch(s,y=>({...y,loaderData:m}))}a._lazyPromise&&await a._lazyPromise;const f=o._nonReactive.minPendingPromise;f&&await f,a._componentsPromise&&await a._componentsPromise,e.updateMatch(s,m=>({...m,error:void 0,context:Ir(e,r),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(c){let u=c;if(u?.name==="AbortError"){if(o.abortController.signal.aborted){o._nonReactive.loaderPromise?.resolve(),o._nonReactive.loaderPromise=void 0;return}e.updateMatch(s,p=>({...p,status:p.status==="pending"?"success":p.status,isFetching:!1,context:Ir(e,r)}));return}const d=o._nonReactive.minPendingPromise;d&&await d,Lt(c)&&await a.options.notFoundComponent?.preload?.(),ar(e,e.router.getMatch(s),c);try{a.options.onError?.(c)}catch(p){u=p,ar(e,e.router.getMatch(s),p)}!en(u)&&!Lt(u)&&await ao(a,["errorComponent"]),e.updateMatch(s,p=>({...p,error:u,context:Ir(e,r),status:"error",isFetching:!1}))}}catch(o){const c=e.router.getMatch(s);c&&(c._nonReactive.loaderPromise=void 0),ar(e,c,o)}},m5=async(e,n,s)=>{async function r(x,k,v,b,N){const C=Date.now()-k.updatedAt,S=x?N.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:N.options.staleTime??e.router.options.defaultStaleTime??0,P=N.options.shouldReload,M=typeof P=="function"?P(q2(e,n,a,s,N)):P,{status:T,invalid:F}=b,R=C>=S&&(!!e.forceStaleReload||b.cause==="enter"||v!==void 0&&v!==b.id);c=T==="success"&&(F||(M??R)),x&&N.options.preload===!1||(c&&!e.sync&&f?(u=!0,(async()=>{try{await Gg(e,n,a,s,N);const B=e.router.getMatch(a);B._nonReactive.loaderPromise?.resolve(),B._nonReactive.loadPromise?.resolve(),B._nonReactive.loaderPromise=void 0,B._nonReactive.loadPromise=void 0}catch(B){en(B)&&await e.router.navigate(B.options)}})()):T!=="success"||c?await Gg(e,n,a,s,N):Qg(e,a,s))}const{id:a,routeId:o}=e.matches[s];let c=!1,u=!1;const d=e.router.looseRoutesById[o],p=d.options.loader,f=((typeof p=="function"?void 0:p?.staleReloadMode)??e.router.options.defaultStaleReloadMode)!=="blocking";if(_2(e,a)){if(!e.router.getMatch(a))return e.matches[s];Qg(e,a,s)}else{const x=e.router.getMatch(a),k=e.router.stores.matchesId.get()[s],v=(k&&e.router.stores.matchStores.get(k)||null)?.routeId===o?k:e.router.stores.matches.get().find(N=>N.routeId===o)?.id,b=su(e,a);if(x._nonReactive.loaderPromise){if(x.status==="success"&&!e.sync&&!x.preload&&f)return x;await x._nonReactive.loaderPromise;const N=e.router.getMatch(a),C=N._nonReactive.error||N.error;C&&ar(e,N,C),N.status==="pending"&&await r(b,x,v,N,d)}else{const N=b&&!e.router.stores.matchStores.has(a),C=e.router.getMatch(a);C._nonReactive.loaderPromise=Ii(),N!==C.preload&&e.updateMatch(a,S=>({...S,preload:N})),await r(b,x,v,C,d)}}const m=e.router.getMatch(a);u||(m._nonReactive.loaderPromise?.resolve(),m._nonReactive.loadPromise?.resolve(),m._nonReactive.loadPromise=void 0),clearTimeout(m._nonReactive.pendingTimeout),m._nonReactive.pendingTimeout=void 0,u||(m._nonReactive.loaderPromise=void 0),m._nonReactive.dehydrated=void 0;const y=u?m.isFetching:!1;return y!==m.isFetching||m.invalid!==!1?(e.updateMatch(a,x=>({...x,isFetching:y,invalid:!1})),e.router.getMatch(a)):m};async function Zg(e){const n=e,s=[];u5(n.router)&&wp(n);let r;for(let y=0;y<n.matches.length;y++){try{const x=p5(n,y);ro(x)&&await x}catch(x){if(en(x))throw x;if(Lt(x))r=x;else if(!n.preload)throw x;break}if(n.serialError||n.firstBadMatchIndex!=null)break}const a=n.firstBadMatchIndex??n.matches.length,o=r&&!n.preload?Yg(n,r):void 0,c=r&&n.preload?0:o!==void 0?Math.min(o+1,a):a;let u,d;for(let y=0;y<c;y++)s.push(m5(n,s,y));try{await Promise.all(s)}catch{const y=await Promise.allSettled(s);for(const x of y){if(x.status!=="rejected")continue;const k=x.reason;if(en(k))throw k;Lt(k)?u??=k:d??=k}if(d!==void 0)throw d}const p=u??(r&&!n.preload?r:void 0);let f=n.firstBadMatchIndex!==void 0?n.firstBadMatchIndex:n.matches.length-1;if(!p&&r&&n.preload)return n.matches;if(p){const y=Yg(n,p);y===void 0&&Ss();const x=n.matches[y],k=n.router.looseRoutesById[x.routeId],v=n.router.options?.defaultNotFoundComponent;!k.options.notFoundComponent&&v&&(k.options.notFoundComponent=v),p.routeId=x.routeId;const b=x.routeId===n.router.routeTree.id;n.updateMatch(x.id,N=>({...N,...b?{status:"success",globalNotFound:!0,error:void 0}:{status:"notFound",error:p},isFetching:!1})),f=y,await ao(k,["notFoundComponent"])}else if(!n.preload){const y=n.matches[0];y.globalNotFound||n.router.getMatch(y.id)?.globalNotFound&&n.updateMatch(y.id,x=>({...x,globalNotFound:!1,error:void 0}))}if(n.serialError&&n.firstBadMatchIndex!==void 0){const y=n.router.looseRoutesById[n.matches[n.firstBadMatchIndex].routeId];await ao(y,["errorComponent"])}for(let y=0;y<=f;y++){const{id:x,routeId:k}=n.matches[y],v=n.router.looseRoutesById[k];try{const b=f5(n,x,v);if(b){const N=await b;n.updateMatch(x,C=>({...C,...N}))}}catch(b){console.error(`Error executing head for route ${k}:`,b)}}const m=wp(n);if(ro(m)&&await m,p)throw p;if(n.serialError&&!n.preload&&!n.onReady)throw n.serialError;return n.matches}function Xg(e,n){const s=n.map(r=>e.options[r]?.preload?.()).filter(Boolean);if(s.length!==0)return Promise.all(s)}function ao(e,n=xc){!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(r=>{const{id:a,...o}=r.options;Object.assign(e.options,o),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0);const s=()=>e._componentsLoaded?void 0:n===xc?(()=>{if(e._componentsPromise===void 0){const r=Xg(e,xc);r?e._componentsPromise=r.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():Xg(e,n);return e._lazyPromise?e._lazyPromise.then(s):s()}function D2(e){for(const n of xc)if(e.options[n]?.preload)return!0;return!1}const xc=["component","errorComponent","pendingComponent","notFoundComponent"];var cr="__TSR_index",Jg="popstate",ex="beforeunload";function g5(e){let n=e.getLocation();const s=new Set,r=c=>{n=e.getLocation(),s.forEach(u=>u({location:n,action:c}))},a=c=>{e.notifyOnIndexChange??!0?r(c):n=e.getLocation()},o=async({task:c,navigateOpts:u,...d})=>{if(u?.ignoreBlocker??!1){c();return}const p=e.getBlockers?.()??[],f=d.type==="PUSH"||d.type==="REPLACE";if(typeof document<"u"&&p.length&&f)for(const m of p){const y=Sc(d.path,d.state);if(await m.blockerFn({currentLocation:n,nextLocation:y,action:d.type})){e.onBlocked?.();return}}c()};return{get location(){return n},get length(){return e.getLength()},subscribers:s,subscribe:c=>(s.add(c),()=>{s.delete(c)}),push:(c,u,d)=>{const p=n.state[cr];u=tx(p+1,u),o({task:()=>{e.pushState(c,u),r({type:"PUSH"})},navigateOpts:d,type:"PUSH",path:c,state:u})},replace:(c,u,d)=>{const p=n.state[cr];u=tx(p,u),o({task:()=>{e.replaceState(c,u),r({type:"REPLACE"})},navigateOpts:d,type:"REPLACE",path:c,state:u})},go:(c,u)=>{o({task:()=>{e.go(c),a({type:"GO",index:c})},navigateOpts:u,type:"GO"})},back:c=>{o({task:()=>{e.back(c?.ignoreBlocker??!1),a({type:"BACK"})},navigateOpts:c,type:"BACK"})},forward:c=>{o({task:()=>{e.forward(c?.ignoreBlocker??!1),a({type:"FORWARD"})},navigateOpts:c,type:"FORWARD"})},canGoBack:()=>n.state[cr]!==0,createHref:c=>e.createHref(c),block:c=>{if(!e.setBlockers)return()=>{};const u=e.getBlockers?.()??[];return e.setBlockers([...u,c]),()=>{const d=e.getBlockers?.()??[];e.setBlockers?.(d.filter(p=>p!==c))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function tx(e,n){n||(n={});const s=bf();return{...n,key:s,__TSR_key:s,[cr]:e}}function x5(e){const n=typeof document<"u"?window:void 0,s=n.history.pushState,r=n.history.replaceState;let a=[];const o=()=>a,c=R=>a=R,u=(R=>R),d=(()=>Sc(`${n.location.pathname}${n.location.search}${n.location.hash}`,n.history.state));if(!n.history.state?.__TSR_key&&!n.history.state?.key){const R=bf();n.history.replaceState({[cr]:0,key:R,__TSR_key:R},"")}let p=d(),f,m=!1,y=!1,x=!1,k=!1;const v=()=>p;let b,N;const C=()=>{b&&(F._ignoreSubscribers=!0,(b.isPush?n.history.pushState:n.history.replaceState)(b.state,"",b.href),F._ignoreSubscribers=!1,b=void 0,N=void 0,f=void 0)},S=(R,B,I)=>{const O=u(B);N||(f=p),p=Sc(B,I),b={href:O,state:I,isPush:b?.isPush||R==="push"},N||(N=Promise.resolve().then(()=>C()))},P=R=>{p=d(),F.notify({type:R})},M=async()=>{if(y){y=!1;return}const R=d(),B=R.state[cr]-p.state[cr],I=B===1,O=B===-1,_=!I&&!O||m;m=!1;const Q=_?"GO":O?"BACK":"FORWARD",q=_?{type:"GO",index:B}:{type:O?"BACK":"FORWARD"};if(x)x=!1;else{const K=o();if(typeof document<"u"&&K.length){for(const ce of K)if(await ce.blockerFn({currentLocation:p,nextLocation:R,action:Q})){y=!0,n.history.go(1),F.notify(q);return}}}p=d(),F.notify(q)},T=R=>{if(k){k=!1;return}let B=!1;const I=o();if(typeof document<"u"&&I.length)for(const O of I){const _=O.enableBeforeUnload??!0;if(_===!0){B=!0;break}if(typeof _=="function"&&_()===!0){B=!0;break}}if(B)return R.preventDefault(),R.returnValue=""},F=g5({getLocation:v,getLength:()=>n.history.length,pushState:(R,B)=>S("push",R,B),replaceState:(R,B)=>S("replace",R,B),back:R=>(R&&(x=!0),k=!0,n.history.back()),forward:R=>{R&&(x=!0),k=!0,n.history.forward()},go:R=>{m=!0,n.history.go(R)},createHref:R=>u(R),flush:C,destroy:()=>{n.history.pushState=s,n.history.replaceState=r,n.removeEventListener(ex,T,{capture:!0}),n.removeEventListener(Jg,M)},onBlocked:()=>{f&&p!==f&&(p=f)},getBlockers:o,setBlockers:c,notifyOnIndexChange:!1});return n.addEventListener(ex,T,{capture:!0}),n.addEventListener(Jg,M),n.history.pushState=function(...R){const B=s.apply(n.history,R);return F._ignoreSubscribers||P("PUSH"),B},n.history.replaceState=function(...R){const B=r.apply(n.history,R);return F._ignoreSubscribers||P("REPLACE"),B},F}function y5(e){let n=e.replace(/[\x00-\x1f\x7f]/g,"");return n.startsWith("//")&&(n="/"+n.replace(/^\/+/,"")),n}function Sc(e,n){const s=y5(e),r=s.indexOf("#"),a=s.indexOf("?"),o=bf();return{href:s,pathname:s.substring(0,r>0?a>0?Math.min(r,a):r:a>0?a:s.length),hash:r>-1?s.substring(r):"",search:a>-1?s.slice(a,r===-1?void 0:r):"",state:n||{[cr]:0,key:o,__TSR_key:o}}}function bf(){return(Math.random()+1).toString(36).substring(7)}function Ti(e,n){const s=n,r=e;return{fromLocation:s,toLocation:r,pathChanged:s?.pathname!==r.pathname,hrefChanged:s?.href!==r.href,hashChanged:s?.hash!==r.hash}}var k5=class{constructor(e,n){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.routeBranchCache=new WeakMap,this.startTransition=s=>s(),this.update=s=>{const r=this.options,a=this.basepath??r?.basepath??"/",o=this.basepath===void 0,c=r?.rewrite;if(this.options={...r,...s},this.isServer=this.options.isServer??typeof document>"u",this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=Y4(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=x5()),this.origin=this.options.origin,this.origin||(window?.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let f;this.resolvePathCache=io(1e3),f=this.buildRouteTree(),this.setRoutes(f)}if(!this.stores&&this.latestLocation){const f=this.getStoreConfig(this);this.batch=f.batch,this.stores=c5(j5(this.latestLocation),f),e5(this)}let u=!1;const d=this.options.basepath??"/",p=this.options.rewrite;if(o||a!==d||c!==p){this.basepath=d;const f=[],m=F2(d);m&&m!=="/"&&f.push(l5({basepath:d})),p&&f.push(p),this.rewrite=f.length===0?void 0:f.length===1?f[0]:o5(f),this.history&&this.updateLatestLocation(),u=!0}u&&this.stores&&this.stores.location.set(this.latestLocation),typeof window<"u"&&"CSS"in window&&typeof window.CSS?.supports=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a)"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const s=B4(this.routeTree,this.options.caseSensitive,(r,a)=>{r.init({originalIndex:a})});return this.options.routeMasks&&L4(this.options.routeMasks,s.processedTree),s},this.subscribe=(s,r)=>{const a={eventType:s,fn:r};return this.subscribers.add(a),()=>{this.subscribers.delete(a)}},this.emit=s=>{this.subscribers.forEach(r=>{r.eventType===s.type&&r.fn(s)})},this.parseLocation=(s,r)=>{const a=({pathname:d,search:p,hash:f,href:m,state:y})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(d)){const N=this.options.parseSearch(p),C=this.options.stringifySearch(N);return{href:d+C+f,publicHref:d+C+f,pathname:Fa(d).path,external:!1,searchStr:C,search:$r(r?.search,N),hash:Fa(f.slice(1)).path,state:rr(r?.state,y)}}const x=new URL(m,this.origin),k=bp(this.rewrite,x),v=this.options.parseSearch(k.search),b=this.options.stringifySearch(v);return k.search=b,{href:k.href.replace(k.origin,""),publicHref:m,pathname:Fa(k.pathname).path,external:!!this.rewrite&&k.origin!==this.origin,searchStr:b,search:$r(r?.search,v),hash:Fa(k.hash.slice(1)).path,state:rr(r?.state,y)}},o=a(s),{__tempLocation:c,__tempKey:u}=o.state;if(c&&(!u||u===this.tempLocationKey)){const d=a(c);return d.state.key=o.state.key,d.state.__TSR_key=o.state.__TSR_key,delete d.state.__tempLocation,{...d,maskedLocation:o}}return o},this.resolvePathWithBase=(s,r)=>K4({base:s,to:r.includes("//")?jf(r):r,trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(s,r,a)=>typeof s=="string"?this.matchRoutesInternal({pathname:s,search:r},a):this.matchRoutesInternal(s,r),this.getMatchedRoutes=s=>b5({pathname:s,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=s=>{const r=this.getMatch(s);r&&(r.abortController.abort(),clearTimeout(r._nonReactive.pendingTimeout),r._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{this.stores.pendingIds.get().forEach(s=>{this.cancelMatch(s)}),this.stores.matchesId.get().forEach(s=>{if(this.stores.pendingMatchStores.has(s))return;const r=this.stores.matchStores.get(s)?.get();r&&(r.status==="pending"||r.isFetching==="loader")&&this.cancelMatch(s)})},this.buildLocation=s=>{const r=(o={})=>{const c=o._fromLocation||this.pendingBuiltLocation||this.latestLocation,u=this.matchRoutesLightweight(c);o.from;const d=o.unsafeRelative==="path"?c.pathname:o.from??u.fullPath,p=o.to?`${o.to}`:void 0,f=u.search,m=Object.assign(Object.create(null),u.params),y=p?.charCodeAt(0)===47?"/":this.resolvePathWithBase(d,"."),x=p?this.resolvePathWithBase(y,p):y,k=o.params===!1||o.params===null?Object.create(null):(o.params??!0)===!0?m:Object.assign(m,sr(o.params,m)),v=this.routesByPath[Ns(x)];let b;if(v)b=this.getRouteBranch(v);else if(x.includes("$"))b=[];else{const O=this.getMatchedRoutes(x);b=O.matchedRoutes,this.options.notFoundRoute&&(!O.foundRoute||O.foundRoute.path!=="/"&&O.routeParams["**"])&&(b=[...b,this.options.notFoundRoute])}if(b.length&&A2(k))for(const O of b){const _=O.options.params?.stringify??O.options.stringifyParams;if(_)try{Object.assign(k,_(k))}catch{}}const N=s.leaveParams?x:Fa(Ug({path:x,params:k,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let C=f;if(s._includeValidateSearch&&this.options.search?.strict){const O={};b.forEach(_=>{if(_.options.validateSearch)try{Object.assign(O,yc(_.options.validateSearch,{...O,...C}))}catch{}}),C=O}C=w5({search:C,dest:o,destRoutes:b,_includeValidateSearch:s._includeValidateSearch}),C=$r(f,C);const S=this.options.stringifySearch(C),P=o.hash===!0?c.hash:o.hash?sr(o.hash,c.hash):void 0,M=P?`#${P}`:"";let T=o.state===!0?c.state:o.state?sr(o.state,c.state):{};T=rr(c.state,T);const F=`${N}${S}${M}`;let R,B,I=!1;if(this.rewrite){const O=new URL(F,this.origin),_=L2(this.rewrite,O);R=O.href.replace(O.origin,""),_.origin!==this.origin?(B=_.href,I=!0):B=_.pathname+_.search+_.hash}else R=z4(F),B=R;return{publicHref:B,href:R,pathname:N,search:C,searchStr:S,state:T,hash:P??"",external:I,unmaskOnReload:o.unmaskOnReload}},a=(o={},c)=>{const u=r(o);let d=c?r(c):void 0;if(!d){const p=Object.create(null);if(this.options.routeMasks){const f=_4(u.pathname,this.processedTree);if(f){Object.assign(p,f.rawParams);const{from:m,params:y,...x}=f.route,k=y===!1||y===null?Object.create(null):(y??!0)===!0?p:Object.assign(p,sr(y,p));c={from:s.from,...x,params:k},d=r(c)}}}return d&&(u.maskedLocation=d),u};return s.mask?a(s,{from:s.from,...s.mask}):a(s)},this.commitLocation=async({viewTransition:s,ignoreBlocker:r,...a})=>{const o=()=>{const d=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];d.forEach(f=>{a.state[f]=this.latestLocation.state[f]});const p=Pr(a.state,this.latestLocation.state);return d.forEach(f=>{delete a.state[f]}),p},c=Ns(this.latestLocation.href)===Ns(a.href);let u=this.commitLocationPromise;if(this.commitLocationPromise=Ii(()=>{u?.resolve(),u=void 0}),c&&o())this.load();else{let{maskedLocation:d,hashScrollIntoView:p,...f}=a;d&&(f={...d,state:{...d.state,__tempKey:void 0,__tempLocation:{...f,search:f.searchStr,state:{...f.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(f.unmaskOnReload??this.options.unmaskOnReload??!1)&&(f.state.__tempKey=this.tempLocationKey)),f.state.__hashScrollIntoViewOptions=p??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=s,this.history[a.replace?"replace":"push"](f.publicHref,f.state,{ignoreBlocker:r})}return this.resetNextScroll=a.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:s,resetScroll:r,hashScrollIntoView:a,viewTransition:o,ignoreBlocker:c,href:u,...d}={})=>{if(u){const m=this.history.location.state.__TSR_index,y=Sc(u,{__TSR_index:s?m:m+1}),x=new URL(y.pathname,this.origin);d.to=bp(this.rewrite,x).pathname,d.search=this.options.parseSearch(y.search),d.hash=y.hash.slice(1)}const p=this.buildLocation({...d,_includeValidateSearch:!0});this.pendingBuiltLocation=p;const f=this.commitLocation({...p,viewTransition:o,replace:s,resetScroll:r,hashScrollIntoView:a,ignoreBlocker:c});return Promise.resolve().then(()=>{this.pendingBuiltLocation===p&&(this.pendingBuiltLocation=void 0)}),f},this.navigate=async({to:s,reloadDocument:r,href:a,publicHref:o,...c})=>{let u=!1;if(a)try{new URL(`${a}`),u=!0}catch{}if(u&&!r&&(r=!0),r){if(s!==void 0||!a){const p=this.buildLocation({to:s,...c});a=a??p.publicHref,o=o??p.publicHref}const d=!u&&o?o:a;if(wc(d,this.protocolAllowlist))return Promise.resolve();if(!c.ignoreBlocker){const p=this.history.getBlockers?.()??[];for(const f of p)if(f?.blockerFn&&await f.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return Promise.resolve()}return c.replace?window.location.replace(d):window.location.href=d,Promise.resolve()}return this.buildAndCommitLocation({...c,href:a,to:s,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();const s=this.matchRoutes(this.latestLocation),r=this.stores.cachedMatches.get().filter(a=>!s.some(o=>o.id===a.id));this.batch(()=>{this.stores.status.set("pending"),this.stores.statusCode.set(200),this.stores.isLoading.set(!0),this.stores.location.set(this.latestLocation),this.stores.setPending(s),this.stores.setCached(r)})},this.load=async s=>{let r,a,o;const c=this.stores.resolvedLocation.get()??this.stores.location.get();for(o=new Promise(d=>{this.startTransition(async()=>{try{this.beforeLoad();const p=this.latestLocation,f=Ti(p,this.stores.resolvedLocation.get());this.stores.redirect.get()||this.emit({type:"onBeforeNavigate",...f}),this.emit({type:"onBeforeLoad",...f}),await Zg({router:this,sync:s?.sync,forceStaleReload:c.href===p.href,matches:this.stores.pendingMatches.get(),location:p,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let m=null,y=null,x=null,k=null;this.batch(()=>{const v=this.stores.pendingMatches.get(),b=v.length,N=this.stores.matches.get();m=b?N.filter(P=>!this.stores.pendingMatchStores.has(P.id)):null;const C=new Set;for(const P of this.stores.pendingMatchStores.values())P.routeId&&C.add(P.routeId);const S=new Set;for(const P of this.stores.matchStores.values())P.routeId&&S.add(P.routeId);y=b?N.filter(P=>!C.has(P.routeId)):null,x=b?v.filter(P=>!S.has(P.routeId)):null,k=b?v.filter(P=>S.has(P.routeId)):N,this.stores.isLoading.set(!1),this.stores.loadedAt.set(Date.now()),b&&(this.stores.setMatches(v),this.stores.setPending([]),this.stores.setCached([...this.stores.cachedMatches.get(),...m.filter(P=>P.status!=="error"&&P.status!=="notFound"&&P.status!=="redirected")]),this.clearExpiredCache())});for(const[v,b]of[[y,"onLeave"],[x,"onEnter"],[k,"onStay"]])if(v)for(const N of v)this.looseRoutesById[N.routeId].options[b]?.(N)})})}})}catch(p){en(p)?(r=p,this.navigate({...r.options,replace:!0,ignoreBlocker:!0})):Lt(p)&&(a=p);const f=r?r.status:a?404:this.stores.matches.get().some(m=>m.status==="error")?500:200;this.batch(()=>{this.stores.statusCode.set(f),this.stores.redirect.set(r)})}this.latestLoadPromise===o&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),d()})}),this.latestLoadPromise=o,await o;this.latestLoadPromise&&o!==this.latestLoadPromise;)await this.latestLoadPromise;let u;this.hasNotFoundMatch()?u=404:this.stores.matches.get().some(d=>d.status==="error")&&(u=500),u!==void 0&&this.stores.statusCode.set(u)},this.startViewTransition=s=>{const r=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,r&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let a;if(typeof r=="object"&&this.isViewTransitionTypesSupported){const o=this.latestLocation,c=this.stores.resolvedLocation.get(),u=typeof r.types=="function"?r.types(Ti(o,c)):r.types;if(u===!1){s();return}a={update:s,types:u}}else a=s;document.startViewTransition(a)}else s()},this.updateMatch=(s,r)=>{this.startTransition(()=>{const a=this.stores.pendingMatchStores.get(s);if(a){a.set(r);return}const o=this.stores.matchStores.get(s);if(o){o.set(r);return}const c=this.stores.cachedMatchStores.get(s);if(c){const u=r(c.get());u.status==="redirected"?this.stores.cachedMatchStores.delete(s)&&this.stores.cachedIds.set(d=>d.filter(p=>p!==s)):c.set(u)}})},this.getMatch=s=>this.stores.cachedMatchStores.get(s)?.get()??this.stores.pendingMatchStores.get(s)?.get()??this.stores.matchStores.get(s)?.get(),this.invalidate=s=>{const r=a=>s?.filter?.(a)??!0?{...a,invalid:!0,...s?.forcePending||a.status==="error"||a.status==="notFound"?{status:"pending",error:void 0}:void 0}:a;return this.batch(()=>{this.stores.setMatches(this.stores.matches.get().map(r)),this.stores.setCached(this.stores.cachedMatches.get().map(r)),this.stores.setPending(this.stores.pendingMatches.get().map(r))}),this.shouldViewTransition=!1,this.load({sync:s?.sync})},this.getParsedLocationHref=s=>s.publicHref||"/",this.resolveRedirect=s=>{const r=s.headers.get("Location");if(!s.options.href||s.options._builtLocation){const a=s.options._builtLocation??this.buildLocation(s.options),o=this.getParsedLocationHref(a);s.options.href=o,s.headers.set("Location",o)}else if(r)try{const a=new URL(r);if(this.origin&&a.origin===this.origin){const o=a.pathname+a.search+a.hash;s.options.href=o,s.headers.set("Location",o)}}catch{}if(s.options.href&&!s.options._builtLocation&&wc(s.options.href,this.protocolAllowlist))throw new Error("Redirect blocked: unsafe protocol");return s.headers.get("Location")||s.headers.set("Location",s.options.href),s},this.clearCache=s=>{const r=s?.filter;r!==void 0?this.stores.setCached(this.stores.cachedMatches.get().filter(a=>!r(a))):this.stores.setCached([])},this.clearExpiredCache=()=>{const s=Date.now(),r=a=>{const o=this.looseRoutesById[a.routeId];if(!o.options.loader)return!0;const c=(a.preload?o.options.preloadGcTime??this.options.defaultPreloadGcTime:o.options.gcTime??this.options.defaultGcTime)??300*1e3;return a.status==="error"?!0:s-a.updatedAt>=c};this.clearCache({filter:r})},this.loadRouteChunk=ao,this.preloadRoute=async s=>{const r=s._builtLocation??this.buildLocation(s);let a=this.matchRoutes(r,{throwOnError:!0,preload:!0,dest:s});const o=new Set([...this.stores.matchesId.get(),...this.stores.pendingIds.get()]),c=new Set([...o,...this.stores.cachedIds.get()]),u=a.filter(d=>!c.has(d.id));if(u.length){const d=this.stores.cachedMatches.get();this.stores.setCached([...d,...u])}try{return a=await Zg({router:this,matches:a,location:r,preload:!0,updateMatch:(d,p)=>{o.has(d)?a=a.map(f=>f.id===d?p(f):f):this.updateMatch(d,p)}}),a}catch(d){if(en(d))return d.options.reloadDocument?void 0:await this.preloadRoute({...d.options,_fromLocation:r});Lt(d)||console.error(d);return}},this.matchRoute=(s,r)=>{const a={...s,to:s.to?this.resolvePathWithBase(s.from||"",s.to):void 0,params:s.params||{},leaveParams:!0},o=this.buildLocation(a);if(r?.pending&&this.stores.status.get()!=="pending")return!1;const c=(r?.pending===void 0?!this.stores.isLoading.get():r.pending)?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),u=O4(o.pathname,r?.caseSensitive??!1,r?.fuzzy??!1,c.pathname,this.processedTree);return!u||s.params&&!Pr(u.rawParams,s.params,{partial:!0})?!1:r?.includeSearch??!0?Pr(c.search,o.search,{partial:!0})?u.rawParams:!1:u.rawParams},this.hasNotFoundMatch=()=>this.stores.matches.get().some(s=>s.status==="notFound"||s.globalNotFound),this.getStoreConfig=n,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??"fuzzy",stringifySearch:e.stringifySearch??r5,parseSearch:e.parseSearch??s5,protocolAllowlist:e.protocolAllowlist??I4}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.stores.__store.get()}setRoutes({routesById:e,routesByPath:n,processedTree:s}){this.routesById=e,this.routesByPath=n,this.processedTree=s;const r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}getRouteBranch(e){let n=this.routeBranchCache.get(e);return n||(n=z2(e),this.routeBranchCache.set(e,n)),n}get looseRoutesById(){return this.routesById}getParentContext(e){return e?.id?e.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(e,n){const s=this.getMatchedRoutes(e.pathname),{foundRoute:r,routeParams:a}=s;let{matchedRoutes:o}=s,c=!1;(r?r.path!=="/"&&a["**"]:Ns(e.pathname))&&(this.options.notFoundRoute?o=[...o,this.options.notFoundRoute]:c=!0);const u=c?S5(this.options.notFoundMode,o):void 0,d=new Array(o.length),p=new Map;for(const f of this.stores.matchStores.values())f.routeId&&p.set(f.routeId,f.get());for(let f=0;f<o.length;f++){const m=o[f],y=d[f-1];let x,k,v;{const _=y?.search??e.search,Q=y?._strictSearch??void 0;try{const q=yc(m.options.validateSearch,{..._})??void 0;x={..._,...q},k={...Q,...q},v=void 0}catch(q){let K=q;if(q instanceof Cc||(K=new Cc(q.message,{cause:q})),n?.throwOnError)throw K;x=_,k={},v=K}}const b=m.options.loaderDeps?.({search:x})??"",N=b?JSON.stringify(b):"",{interpolatedPath:C,usedParams:S}=Ug({path:m.fullPath,params:a,decoder:this.pathParamsDecoder,server:this.isServer}),P=m.id+C+N,M=this.getMatch(P),T=p.get(m.id),F=M?._strictParams??S;let R;if(!M)try{nx(m,F)}catch(_){if(Lt(_)||en(_)?R=_:R=new v5(_.message,{cause:_}),n?.throwOnError)throw R}Object.assign(a,F);const B=T?"stay":"enter";let I;if(M)I={...M,cause:B,params:T?.params??a,_strictParams:F,search:$r(T?T.search:M.search,x),_strictSearch:k};else{const _=m.options.loader||m.options.beforeLoad||m.lazyFn||D2(m)?"pending":"success";I={id:P,ssr:m.options.ssr,index:f,routeId:m.id,params:T?.params??a,_strictParams:F,pathname:C,updatedAt:Date.now(),search:T?$r(T.search,x):x,_strictSearch:k,searchError:void 0,status:_,isFetching:!1,error:void 0,paramsError:R,__routeContext:void 0,_nonReactive:{loadPromise:Ii()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:B,loaderDeps:T?rr(T.loaderDeps,b):b,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:m.options.staticData||{},fullPath:m.fullPath}}n?.preload||(I.globalNotFound=u===m.id),I.searchError=v;const O=this.getParentContext(y);I.context={...O,...I.__routeContext,...I.__beforeLoadContext},d[f]=I}for(let f=0;f<d.length;f++){const m=d[f],y=this.looseRoutesById[m.routeId],x=this.getMatch(m.id),k=p.get(m.routeId);if(m.params=k?$r(k.params,a):a,!x){const v=d[f-1],b=this.getParentContext(v);if(y.options.context){const N={deps:m.loaderDeps,params:m.params,context:b??{},location:e,navigate:C=>this.navigate({...C,_fromLocation:e}),buildLocation:this.buildLocation,cause:m.cause,abortController:m.abortController,preload:!!m.preload,matches:d,routeId:y.id};m.__routeContext=y.options.context(N)??void 0}m.context={...b,...m.__routeContext,...m.__beforeLoadContext}}}return d}matchRoutesLightweight(e){const{matchedRoutes:n,routeParams:s}=this.getMatchedRoutes(e.pathname),r=so(n),a={...e.search};for(const p of n)try{Object.assign(a,yc(p.options.validateSearch,a))}catch{}const o=so(this.stores.matchesId.get()),c=o&&this.stores.matchStores.get(o)?.get(),u=c&&c.routeId===r.id&&c.pathname===e.pathname;let d;if(u)d=c.params;else{const p=Object.assign(Object.create(null),s);for(const f of n)try{nx(f,p)}catch{}d=p}return{matchedRoutes:n,fullPath:r.fullPath,search:a,params:d}}},Cc=class extends Error{},v5=class extends Error{};function j5(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],statusCode:200}}function yc(e,n){if(e==null)return{};if("~standard"in e){const s=e["~standard"].validate(n);if(s instanceof Promise)throw new Cc("Async validation not supported");if(s.issues)throw new Cc(JSON.stringify(s.issues,void 0,2),{cause:s});return s.value}return"parse"in e?e.parse(n):typeof e=="function"?e(n):{}}function b5({pathname:e,routesById:n,processedTree:s}){const r=Object.create(null),a=Ns(e);let o;const c=q4(a,s,!0);return c&&(o=c.route,Object.assign(r,c.rawParams)),{matchedRoutes:c?.branch||[n.__root__],routeParams:r,foundRoute:o}}function w5({search:e,dest:n,destRoutes:s,_includeValidateSearch:r}){return N5(s)(e,n,r??!1)}function N5(e){const n={dest:null,_includeValidateSearch:!1,middlewares:[]};for(const a of e){if("search"in a.options)a.options.search?.middlewares&&n.middlewares.push(...a.options.search.middlewares);else if(a.options.preSearchFilters||a.options.postSearchFilters){const o=({search:c,next:u})=>{let d=c;"preSearchFilters"in a.options&&a.options.preSearchFilters&&(d=a.options.preSearchFilters.reduce((f,m)=>m(f),c));const p=u(d);return"postSearchFilters"in a.options&&a.options.postSearchFilters?a.options.postSearchFilters.reduce((f,m)=>m(f),p):p};n.middlewares.push(o)}if(a.options.validateSearch){const o=({search:c,next:u})=>{const d=u(c);if(!n._includeValidateSearch)return d;try{return{...d,...yc(a.options.validateSearch,d)??void 0}}catch{return d}};n.middlewares.push(o)}}const s=({search:a})=>{const o=n.dest;return o.search?o.search===!0?a:sr(o.search,a):{}};n.middlewares.push(s);const r=(a,o,c)=>{if(a>=c.length)return o;const u=c[a];return u({search:o,next:p=>r(a+1,p,c)})};return function(o,c,u){return n.dest=c,n._includeValidateSearch=u,r(0,o,n.middlewares)}}function S5(e,n){if(e!=="root")for(let s=n.length-1;s>=0;s--){const r=n[s];if(r.children)return r.id}return Rr}function nx(e,n){const s=e.options.params?.parse??e.options.parseParams;if(s){const r=s(n);if(r===!1)throw new Error("Route params.parse returned false for a matched route");Object.assign(n,r)}}const C5="Error preloading route! ☝️";var B2=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=n=>{this.originalIndex=n.originalIndex;const s=this.options,r=!s?.path&&!s?.id;this.parentRoute=this.options.getParentRoute?.(),r?this._path=Rr:this.parentRoute||Ss();let a=r?Rr:s?.path;a&&a!=="/"&&(a=M2(a));const o=s?.id||a;let c=r?Rr:gc([this.parentRoute.id==="__root__"?"":this.parentRoute.id,o]);a==="__root__"&&(a="/"),c!=="__root__"&&(c=gc(["/",c]));const u=c==="__root__"?"/":gc([this.parentRoute.fullPath,a]);this._path=a,this._id=c,this._fullPath=u,this._to=Ns(u)},this.addChildren=n=>this._addFileChildren(n),this._addFileChildren=n=>(Array.isArray(n)&&(this.children=n),typeof n=="object"&&n!==null&&(this.children=Object.values(n)),this),this._addFileTypes=()=>this,this.updateLoader=n=>(Object.assign(this.options,n),this),this.update=n=>(Object.assign(this.options,n),this),this.lazy=n=>(this.lazyFn=n,this),this.redirect=n=>nu({from:this.fullPath,...n}),this.options=e||{},this.isRoot=!e?.getParentRoute,e?.id&&e?.path)throw new Error("Route cannot have both an 'id' and a 'path' option.")}},$5=class extends B2{constructor(e){super(e)}};function E5(e){if(typeof document<"u"&&document.querySelector){const n=e.stores.location.get(),s=n.state.__hashScrollIntoViewOptions??!0;if(s&&n.hash!==""){const r=document.getElementById(n.hash);r&&r.scrollIntoView(s)}}}function wf(e){const n=e.errorComponent??Nf;return t.jsx(T5,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:s,reset:r})=>s?$.createElement(n,{error:s,reset:r}):e.children})}var T5=class extends $.Component{constructor(...e){super(...e),this.state={error:null}}static getDerivedStateFromProps(e,n){const s=e.getResetKey();return n.error&&n.resetKey!==s?{resetKey:s,error:null}:{resetKey:s}}static getDerivedStateFromError(e){return{error:e}}reset(){this.setState({error:null})}componentDidCatch(e,n){this.props.onCatch&&this.props.onCatch(e,n)}render(){return this.props.children({error:this.state.error,reset:()=>{this.reset()}})}};function Nf({error:e}){const[n,s]=$.useState(!1);return t.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[t.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),t.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>s(r=>!r),children:n?"Hide Error":"Show Error"})]}),t.jsx("div",{style:{height:".25rem"}}),n?t.jsx("div",{children:t.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?t.jsx("code",{children:e.message}):null})}):null]})}function A5({children:e,fallback:n=null}){return W2()?t.jsx(Ja.Fragment,{children:e}):t.jsx(Ja.Fragment,{children:n})}function W2(){return Ja.useSyncExternalStore(P5,()=>!0,()=>!1)}function P5(){return()=>{}}var U2=$.createContext(null);function sn(e){return $.useContext(U2)}var ru=$.createContext(void 0),R5=$.createContext(void 0),nt=(e=>(e[e.None=0]="None",e[e.Mutable=1]="Mutable",e[e.Watching=2]="Watching",e[e.RecursedCheck=4]="RecursedCheck",e[e.Recursed=8]="Recursed",e[e.Dirty=16]="Dirty",e[e.Pending=32]="Pending",e))(nt||{});function I5({update:e,notify:n,unwatched:s}){return{link:r,unlink:a,propagate:o,checkDirty:c,shallowPropagate:u};function r(p,f,m){const y=f.depsTail;if(y!==void 0&&y.dep===p)return;const x=y!==void 0?y.nextDep:f.deps;if(x!==void 0&&x.dep===p){x.version=m,f.depsTail=x;return}const k=p.subsTail;if(k!==void 0&&k.version===m&&k.sub===f)return;const v=f.depsTail=p.subsTail={version:m,dep:p,sub:f,prevDep:y,nextDep:x,prevSub:k,nextSub:void 0};x!==void 0&&(x.prevDep=v),y!==void 0?y.nextDep=v:f.deps=v,k!==void 0?k.nextSub=v:p.subs=v}function a(p,f=p.sub){const m=p.dep,y=p.prevDep,x=p.nextDep,k=p.nextSub,v=p.prevSub;return x!==void 0?x.prevDep=y:f.depsTail=y,y!==void 0?y.nextDep=x:f.deps=x,k!==void 0?k.prevSub=v:m.subsTail=v,v!==void 0?v.nextSub=k:(m.subs=k)===void 0&&s(m),x}function o(p){let f=p.nextSub,m;e:do{const y=p.sub;let x=y.flags;if(x&60?x&12?x&4?!(x&48)&&d(p,y)?(y.flags=x|40,x&=1):x=0:y.flags=x&-9|32:x=0:y.flags=x|32,x&2&&n(y),x&1){const k=y.subs;if(k!==void 0){const v=(p=k).nextSub;v!==void 0&&(m={value:f,prev:m},f=v);continue}}if((p=f)!==void 0){f=p.nextSub;continue}for(;m!==void 0;)if(p=m.value,m=m.prev,p!==void 0){f=p.nextSub;continue e}break}while(!0)}function c(p,f){let m,y=0,x=!1;e:do{const k=p.dep,v=k.flags;if(f.flags&16)x=!0;else if((v&17)===17){if(e(k)){const b=k.subs;b.nextSub!==void 0&&u(b),x=!0}}else if((v&33)===33){(p.nextSub!==void 0||p.prevSub!==void 0)&&(m={value:p,prev:m}),p=k.deps,f=k,++y;continue}if(!x){const b=p.nextDep;if(b!==void 0){p=b;continue}}for(;y--;){const b=f.subs,N=b.nextSub!==void 0;if(N?(p=m.value,m=m.prev):p=b,x){if(e(f)){N&&u(b),f=p.sub;continue}x=!1}else f.flags&=-33;f=p.sub;const C=p.nextDep;if(C!==void 0){p=C;continue e}}return x}while(!0)}function u(p){do{const f=p.sub,m=f.flags;(m&48)===32&&(f.flags=m|16,(m&6)===2&&n(f))}while((p=p.nextSub)!==void 0)}function d(p,f){let m=f.depsTail;for(;m!==void 0;){if(m===p)return!0;m=m.prevDep}return!1}}function z5(e,n,s){const r=typeof e=="object",a=r?e:void 0;return{next:(r?e.next:e)?.bind(a),error:(r?e.error:n)?.bind(a),complete:(r?e.complete:s)?.bind(a)}}const Np=[];let kc=0;const{link:sx,unlink:M5,propagate:F5,checkDirty:H2,shallowPropagate:rx}=I5({update(e){return e._update()},notify(e){Np[Sp++]=e,e.flags&=~nt.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=nt.Mutable|nt.Dirty,$c(e))}});let sc=0,Sp=0,ss,Cp=0;function V2(e){try{++Cp,e()}finally{--Cp||K2()}}function $c(e){const n=e.depsTail;let s=n!==void 0?n.nextDep:e.deps;for(;s!==void 0;)s=M5(s,e)}function K2(){if(!(Cp>0)){for(;sc<Sp;){const e=Np[sc];Np[sc++]=void 0,e.notify()}sc=0,Sp=0}}function ix(e,n){const s=typeof e=="function",r=e,a={_snapshot:s?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:s?nt.None:nt.Mutable,get(){return ss!==void 0&&sx(a,ss,kc),a._snapshot},subscribe(o){const c=z5(o),u={current:!1},d=L5(()=>{a.get(),u.current?c.next?.(a._snapshot):u.current=!0});return{unsubscribe:()=>{d.stop()}}},_update(o){const c=ss,u=n?.compare??Object.is;if(s)ss=a,++kc,a.depsTail=void 0;else if(o===void 0)return!1;s&&(a.flags=nt.Mutable|nt.RecursedCheck);try{const d=a._snapshot,p=typeof o=="function"?o(d):o===void 0&&s?r(d):o;return d===void 0||!u(d,p)?(a._snapshot=p,!0):!1}finally{ss=c,s&&(a.flags&=~nt.RecursedCheck),$c(a)}}};return s?(a.flags=nt.Mutable|nt.Dirty,a.get=function(){const o=a.flags;if(o&nt.Dirty||o&nt.Pending&&H2(a.deps,a)){if(a._update()){const c=a.subs;c!==void 0&&rx(c)}}else o&nt.Pending&&(a.flags=o&~nt.Pending);return ss!==void 0&&sx(a,ss,kc),a._snapshot}):a.set=function(o){if(a._update(o)){const c=a.subs;c!==void 0&&(F5(c),rx(c),K2())}},a}function L5(e){const n=()=>{const r=ss;ss=s,++kc,s.depsTail=void 0,s.flags=nt.Watching|nt.RecursedCheck;try{return e()}finally{ss=r,s.flags&=~nt.RecursedCheck,$c(s)}},s={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:nt.Watching|nt.RecursedCheck,notify(){const r=this.flags;r&nt.Dirty||r&nt.Pending&&H2(this.deps,this)?n():this.flags=nt.Watching},stop(){this.flags=nt.None,this.depsTail=void 0,$c(this)}};return n(),s}var Ch={exports:{}},$h={},Eh={exports:{}},Th={};/**
41
- * @license React
42
- * use-sync-external-store-shim.production.js
43
- *
44
- * Copyright (c) Meta Platforms, Inc. and affiliates.
45
- *
46
- * This source code is licensed under the MIT license found in the
47
- * LICENSE file in the root directory of this source tree.
48
- */var ax;function _5(){if(ax)return Th;ax=1;var e=So();function n(m,y){return m===y&&(m!==0||1/m===1/y)||m!==m&&y!==y}var s=typeof Object.is=="function"?Object.is:n,r=e.useState,a=e.useEffect,o=e.useLayoutEffect,c=e.useDebugValue;function u(m,y){var x=y(),k=r({inst:{value:x,getSnapshot:y}}),v=k[0].inst,b=k[1];return o(function(){v.value=x,v.getSnapshot=y,d(v)&&b({inst:v})},[m,x,y]),a(function(){return d(v)&&b({inst:v}),m(function(){d(v)&&b({inst:v})})},[m]),c(x),x}function d(m){var y=m.getSnapshot;m=m.value;try{var x=y();return!s(m,x)}catch{return!0}}function p(m,y){return y()}var f=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?p:u;return Th.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:f,Th}var ox;function O5(){return ox||(ox=1,Eh.exports=_5()),Eh.exports}/**
49
- * @license React
50
- * use-sync-external-store-shim/with-selector.production.js
51
- *
52
- * Copyright (c) Meta Platforms, Inc. and affiliates.
53
- *
54
- * This source code is licensed under the MIT license found in the
55
- * LICENSE file in the root directory of this source tree.
56
- */var lx;function q5(){if(lx)return $h;lx=1;var e=So(),n=O5();function s(p,f){return p===f&&(p!==0||1/p===1/f)||p!==p&&f!==f}var r=typeof Object.is=="function"?Object.is:s,a=n.useSyncExternalStore,o=e.useRef,c=e.useEffect,u=e.useMemo,d=e.useDebugValue;return $h.useSyncExternalStoreWithSelector=function(p,f,m,y,x){var k=o(null);if(k.current===null){var v={hasValue:!1,value:null};k.current=v}else v=k.current;k=u(function(){function N(T){if(!C){if(C=!0,S=T,T=y(T),x!==void 0&&v.hasValue){var F=v.value;if(x(F,T))return P=F}return P=T}if(F=P,r(S,T))return F;var R=y(T);return x!==void 0&&x(F,R)?(S=T,F):(S=T,P=R)}var C=!1,S,P,M=m===void 0?null:m;return[function(){return N(f())},M===null?void 0:function(){return N(M())}]},[f,m,y,x]);var b=a(p,k[0],k[1]);return c(function(){v.hasValue=!0,v.value=b},[b]),d(b),b},$h}var cx;function D5(){return cx||(cx=1,Ch.exports=q5()),Ch.exports}var B5=D5();function W5(e,n){return e===n}function tn(e,n,s=W5){const r=$.useCallback(c=>{if(!e)return()=>{};const{unsubscribe:u}=e.subscribe(c);return u},[e]),a=$.useCallback(()=>e?.get(),[e]);return B5.useSyncExternalStoreWithSelector(r,a,a,n,s)}var U5={get:()=>{},subscribe:()=>({unsubscribe:()=>{}})};function Ur(e){const n=sn(),s=$.useContext(e.from?R5:ru),r=e.from??s,a=r?e.from?n.stores.getRouteMatchStore(r):n.stores.matchStores.get(r):void 0,o=$.useRef(void 0);return tn(a??U5,c=>{if((e.shouldThrow??!0)&&!c&&Ss(),c===void 0)return;const u=e.select?e.select(c):c;if(e.structuralSharing??n.options.defaultStructuralSharing){const d=rr(o.current,u);return o.current=d,d}return u})}function Y2(e){return Ur({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:n=>e.select?e.select(n.loaderData):n.loaderData})}function Q2(e){const{select:n,...s}=e;return Ur({...s,select:r=>n?n(r.loaderDeps):r.loaderDeps})}function iu(e){return Ur({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:n=>{const s=e.strict===!1?n.params:n._strictParams;return e.select?e.select(s):s}})}function Di(e){return Ur({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:n=>e.select?e.select(n.search):n.search})}function rn(e){const n=sn();return $.useCallback(s=>n.navigate({...s,from:s.from??e?.from}),[e?.from,n])}function G2(e){return Ur({...e,select:n=>e.select?e.select(n.context):n.context})}var au=d2();function H5(e,n){const s=sn(),r=T4(n),{activeProps:a,inactiveProps:o,activeOptions:c,to:u,preload:d,preloadDelay:p,preloadIntentProximity:f,hashScrollIntoView:m,replace:y,startTransition:x,resetScroll:k,viewTransition:v,children:b,target:N,disabled:C,style:S,className:P,onClick:M,onBlur:T,onFocus:F,onMouseEnter:R,onMouseLeave:B,onTouchStart:I,ignoreBlocker:O,params:_,search:Q,hash:q,state:K,mask:ce,reloadDocument:H,unsafeRelative:V,from:ne,_fromLocation:A,...D}=e,ee=W2(),z=$.useMemo(()=>e,[s,e.from,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),me=tn(s.stores.location,He=>He,(He,X)=>He.href===X.href),he=$.useMemo(()=>{const He={_fromLocation:me,...z};return s.buildLocation(He)},[s,me,z]),ke=he.maskedLocation?he.maskedLocation.publicHref:he.publicHref,Re=he.maskedLocation?he.maskedLocation.external:he.external,Ae=$.useMemo(()=>Z5(ke,Re,s.history,C),[C,Re,ke,s.history]),$e=$.useMemo(()=>{if(Ae?.external)return wc(Ae.href,s.protocolAllowlist)?void 0:Ae.href;if(!X5(u)&&!(typeof u!="string"||u.indexOf(":")===-1))try{return new URL(u),wc(u,s.protocolAllowlist)?void 0:u}catch{}},[u,Ae,s.protocolAllowlist]),De=$.useMemo(()=>{if($e)return!1;if(c?.exact){if(!V4(me.pathname,he.pathname,s.basepath))return!1}else{const He=Nc(me.pathname,s.basepath),X=Nc(he.pathname,s.basepath);if(!(He.startsWith(X)&&(He.length===X.length||He[X.length]==="/")))return!1}return(c?.includeSearch??!0)&&!Pr(me.search,he.search,{partial:!c?.exact,ignoreUndefined:!c?.explicitUndefined})?!1:c?.includeHash?ee&&me.hash===he.hash:!0},[c?.exact,c?.explicitUndefined,c?.includeHash,c?.includeSearch,me,$e,ee,he.hash,he.pathname,he.search,s.basepath]),ct=De?sr(a,{})??V5:Ah,Ut=De?Ah:sr(o,{})??Ah,on=[P,ct.className,Ut.className].filter(Boolean).join(" "),Kn=(S||ct.style||Ut.style)&&{...S,...ct.style,...Ut.style},[Ht,Mn]=$.useState(!1),bn=$.useRef(!1),ln=e.reloadDocument||$e?!1:d??s.options.defaultPreload,Vt=p??s.options.defaultPreloadDelay??0,xt=$.useCallback(()=>{s.preloadRoute({...z,_builtLocation:he}).catch(He=>{console.warn(He),console.warn(C5)})},[s,z,he]);E4(r,$.useCallback(He=>{He?.isIntersecting&&xt()},[xt]),G5,{disabled:!!C||ln!=="viewport"}),$.useEffect(()=>{bn.current||!C&&ln==="render"&&(xt(),bn.current=!0)},[C,xt,ln]);const cn=He=>{const X=He.currentTarget.getAttribute("target"),le=N!==void 0?N:X;if(!C&&!J5(He)&&!He.defaultPrevented&&(!le||le==="_self")&&He.button===0){He.preventDefault(),au.flushSync(()=>{Mn(!0)});const be=s.subscribe("onResolved",()=>{be(),Mn(!1)});s.navigate({...z,replace:y,resetScroll:k,hashScrollIntoView:m,startTransition:x,viewTransition:v,ignoreBlocker:O})}};if($e)return{...D,ref:r,href:$e,...b&&{children:b},...N&&{target:N},...C&&{disabled:C},...S&&{style:S},...P&&{className:P},...M&&{onClick:M},...T&&{onBlur:T},...F&&{onFocus:F},...R&&{onMouseEnter:R},...B&&{onMouseLeave:B},...I&&{onTouchStart:I}};const Yn=He=>{if(C||ln!=="intent")return;if(!Vt){xt();return}const X=He.currentTarget;if(Oa.has(X))return;const le=setTimeout(()=>{Oa.delete(X),xt()},Vt);Oa.set(X,le)},Ms=He=>{C||ln!=="intent"||xt()},Qn=He=>{if(C||!ln||!Vt)return;const X=He.currentTarget,le=Oa.get(X);le&&(clearTimeout(le),Oa.delete(X))};return{...D,...ct,...Ut,href:Ae?.href,ref:r,onClick:bi([M,cn]),onBlur:bi([T,Qn]),onFocus:bi([F,Yn]),onMouseEnter:bi([R,Yn]),onMouseLeave:bi([B,Qn]),onTouchStart:bi([I,Ms]),disabled:!!C,target:N,...Kn&&{style:Kn},...on&&{className:on},...C&&K5,...De&&Y5,...ee&&Ht&&Q5}}var Ah={},V5={className:"active"},K5={role:"link","aria-disabled":!0},Y5={"data-status":"active","aria-current":"page"},Q5={"data-transitioning":"transitioning"},Oa=new WeakMap,G5={rootMargin:"100px"},bi=e=>n=>{for(const s of e)if(s){if(n.defaultPrevented)return;s(n)}};function Z5(e,n,s,r){if(!r)return n?{href:e,external:!0}:{href:s.createHref(e)||"/",external:!1}}function X5(e){if(typeof e!="string")return!1;const n=e.charCodeAt(0);return n===47?e.charCodeAt(1)!==47:n===46}var Te=$.forwardRef((e,n)=>{const{_asChild:s,...r}=e,{type:a,...o}=H5(r,n),c=typeof r.children=="function"?r.children({isActive:o["data-status"]==="active"}):r.children;if(!s){const{disabled:u,...d}=o;return $.createElement("a",d,c)}return $.createElement(s,o,c)});function J5(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var e6=class extends B2{constructor(e){super(e),this.useMatch=n=>Ur({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>G2({...n,from:this.id}),this.useSearch=n=>Di({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>iu({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>Q2({...n,from:this.id}),this.useLoaderData=n=>Y2({...n,from:this.id}),this.useNavigate=()=>rn({from:this.fullPath}),this.Link=Ja.forwardRef((n,s)=>t.jsx(Te,{ref:s,from:this.fullPath,...n}))}};function Ot(e){return new e6(e)}var t6=class extends $5{constructor(e){super(e),this.useMatch=n=>Ur({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>G2({...n,from:this.id}),this.useSearch=n=>Di({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>iu({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>Q2({...n,from:this.id}),this.useLoaderData=n=>Y2({...n,from:this.id}),this.useNavigate=()=>rn({from:this.fullPath}),this.Link=Ja.forwardRef((n,s)=>t.jsx(Te,{ref:s,from:this.fullPath,...n}))}};function n6(e){return new t6(e)}function s6(e){const n=sn(),s=`not-found-${tn(n.stores.location,r=>r.pathname)}-${tn(n.stores.status,r=>r)}`;return t.jsx(wf,{getResetKey:()=>s,onCatch:(r,a)=>{if(Lt(r))e.onCatch?.(r,a);else throw r},errorComponent:({error:r})=>{if(Lt(r))return e.fallback?.(r);throw r},children:e.children})}function r6(){return t.jsx("p",{children:"Not Found"})}function $i(e){return t.jsx(t.Fragment,{children:e.children})}function Z2(e,n,s){return n.options.notFoundComponent?t.jsx(n.options.notFoundComponent,{...s}):e.options.defaultNotFoundComponent?t.jsx(e.options.defaultNotFoundComponent,{...s}):t.jsx(r6,{})}function i6(e){return null}function a6(){return i6(sn()),null}var X2=$.memo(function({matchId:n}){const s=sn(),r=s.stores.matchStores.get(n);r||Ss();const a=tn(s.stores.loadedAt,c=>c),o=tn(r,c=>c);return t.jsx(o6,{router:s,matchId:n,resetKey:a,matchState:$.useMemo(()=>{const c=o.routeId,u=s.routesById[c].parentRoute?.id;return{routeId:c,ssr:o.ssr,_displayPending:o._displayPending,parentRouteId:u}},[o._displayPending,o.routeId,o.ssr,s.routesById])})});function o6({router:e,matchId:n,resetKey:s,matchState:r}){const a=e.routesById[r.routeId],o=a.options.pendingComponent??e.options.defaultPendingComponent,c=o?t.jsx(o,{}):null,u=a.options.errorComponent??e.options.defaultErrorComponent,d=a.options.onCatch??e.options.defaultOnCatch,p=a.isRoot?a.options.notFoundComponent??e.options.notFoundRoute?.options.component:a.options.notFoundComponent,f=r.ssr===!1||r.ssr==="data-only",m=(!a.isRoot||a.options.wrapInSuspense||f)&&(a.options.wrapInSuspense??o??(a.options.errorComponent?.preload||f))?$.Suspense:$i,y=u?wf:$i,x=p?s6:$i;return t.jsxs(a.isRoot?a.options.shellComponent??$i:$i,{children:[t.jsx(ru.Provider,{value:n,children:t.jsx(m,{fallback:c,children:t.jsx(y,{getResetKey:()=>s,errorComponent:u||Nf,onCatch:(k,v)=>{if(Lt(k))throw k.routeId??=r.routeId,k;d?.(k,v)},children:t.jsx(x,{fallback:k=>{if(k.routeId??=r.routeId,!p||k.routeId&&k.routeId!==r.routeId||!k.routeId&&!a.isRoot)throw k;return $.createElement(p,k)},children:f||r._displayPending?t.jsx(A5,{fallback:c,children:t.jsx(ux,{matchId:n})}):t.jsx(ux,{matchId:n})})})})}),r.parentRouteId===Rr?t.jsxs(t.Fragment,{children:[t.jsx(l6,{resetKey:s}),e.options.scrollRestoration&&E2?t.jsx(a6,{}):null]}):null]})}function l6({resetKey:e}){const n=sn(),s=$.useRef(void 0);return Ha(()=>{const r=n.latestLocation.href;(s.current===void 0||s.current!==r)&&(n.emit({type:"onRendered",...Ti(n.stores.location.get(),n.stores.resolvedLocation.get())}),s.current=r)},[n.latestLocation.state.__TSR_key,e,n]),null}var ux=$.memo(function({matchId:n}){const s=sn(),r=(f,m)=>s.getMatch(f.id)?._nonReactive[m]??f._nonReactive[m],a=s.stores.matchStores.get(n);a||Ss();const o=tn(a,f=>f),c=o.routeId,u=s.routesById[c],d=$.useMemo(()=>{const f=(s.routesById[c].options.remountDeps??s.options.defaultRemountDeps)?.({routeId:c,loaderDeps:o.loaderDeps,params:o._strictParams,search:o._strictSearch});return f?JSON.stringify(f):void 0},[c,o.loaderDeps,o._strictParams,o._strictSearch,s.options.defaultRemountDeps,s.routesById]),p=$.useMemo(()=>{const f=u.options.component??s.options.defaultComponent;return f?t.jsx(f,{},d):t.jsx($p,{})},[d,u.options.component,s.options.defaultComponent]);if(o._displayPending)throw r(o,"displayPendingPromise");if(o._forcePending)throw r(o,"minPendingPromise");if(o.status==="pending"){const f=u.options.pendingMinMs??s.options.defaultPendingMinMs;if(f){const m=s.getMatch(o.id);if(m&&!m._nonReactive.minPendingPromise){const y=Ii();m._nonReactive.minPendingPromise=y,setTimeout(()=>{y.resolve(),m._nonReactive.minPendingPromise=void 0},f)}}throw r(o,"loadPromise")}if(o.status==="notFound")return Lt(o.error)||Ss(),Z2(s,u,o.error);if(o.status==="redirected")throw en(o.error)||Ss(),r(o,"loadPromise");if(o.status==="error")throw o.error;return p}),$p=$.memo(function(){const n=sn(),s=$.useContext(ru);let r,a=!1,o;{const p=s?n.stores.matchStores.get(s):void 0;[r,a]=tn(p,f=>[f?.routeId,f?.globalNotFound??!1]),o=tn(n.stores.matchesId,f=>f[f.findIndex(m=>m===s)+1])}const c=r?n.routesById[r]:void 0,u=n.options.defaultPendingComponent?t.jsx(n.options.defaultPendingComponent,{}):null;if(a)return c||Ss(),Z2(n,c,void 0);if(!o)return null;const d=t.jsx(X2,{matchId:o});return r===Rr?t.jsx($.Suspense,{fallback:u,children:d}):d});function c6(){const e=sn(),n=$.useRef({router:e,mounted:!1}),[s,r]=$.useState(!1),a=tn(e.stores.isLoading,m=>m),o=tn(e.stores.hasPending,m=>m),c=kh(a),u=a||s||o,d=kh(u),p=a||o,f=kh(p);return e.startTransition=m=>{r(!0),$.startTransition(()=>{m(),r(!1)})},$.useEffect(()=>{const m=e.history.subscribe(e.load),y=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Ns(e.latestLocation.publicHref)!==Ns(y.publicHref)&&e.commitLocation({...y,replace:!0}),()=>{m()}},[e,e.history]),Ha(()=>{if(typeof window<"u"&&e.ssr||n.current.router===e&&n.current.mounted)return;n.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(y){console.error(y)}})()},[e]),Ha(()=>{c&&!a&&e.emit({type:"onLoad",...Ti(e.stores.location.get(),e.stores.resolvedLocation.get())})},[c,e,a]),Ha(()=>{f&&!p&&e.emit({type:"onBeforeRouteMount",...Ti(e.stores.location.get(),e.stores.resolvedLocation.get())})},[p,f,e]),Ha(()=>{if(d&&!u){const m=Ti(e.stores.location.get(),e.stores.resolvedLocation.get());e.emit({type:"onResolved",...m}),V2(()=>{e.stores.status.set("idle"),e.stores.resolvedLocation.set(e.stores.location.get())}),m.hrefChanged&&E5(e)}},[u,d,e]),null}function u6(){const e=sn(),n=e.routesById[Rr].options.pendingComponent??e.options.defaultPendingComponent,s=n?t.jsx(n,{}):null,r=t.jsxs(typeof document<"u"&&e.ssr?$i:$.Suspense,{fallback:s,children:[t.jsx(c6,{}),t.jsx(d6,{})]});return e.options.InnerWrap?t.jsx(e.options.InnerWrap,{children:r}):r}function d6(){const e=sn(),n=tn(e.stores.firstId,a=>a),s=tn(e.stores.loadedAt,a=>a),r=n?t.jsx(X2,{matchId:n}):null;return t.jsx(ru.Provider,{value:n,children:e.options.disableGlobalCatchBoundary?r:t.jsx(wf,{getResetKey:()=>s,errorComponent:Nf,onCatch:void 0,children:r})})}var h6=e=>({createMutableStore:ix,createReadonlyStore:ix,batch:V2}),p6=e=>new f6(e),f6=class extends k5{constructor(e){super(e,h6)}};function m6({router:e,children:n,...s}){A2(s)&&e.update({...e.options,...s,context:{...e.options.context,...s.context}});const r=t.jsx(U2.Provider,{value:e,children:n});return e.options.Wrap?t.jsx(e.options.Wrap,{children:r}):r}function g6({router:e,...n}){return t.jsx(m6,{router:e,...n,children:t.jsx(u6,{})})}function Ec(e){const n=sn({warn:e?.router===void 0}),s=e?.router||n,r=$.useRef(void 0);return tn(s.stores.__store,a=>{if(e?.select){if(e.structuralSharing??s.options.defaultStructuralSharing){const o=rr(r.current,e.select(a));return r.current=o,o}return e.select(a)}return a})}let oo="up",Tc=0,J2=!1;const Ac=new Set;function Sf(e){if(e!==oo){oo=e;for(const n of Ac)n()}}function x6(e){Tc=0,Sf(e===401?"link-old":"up")}function ek(){Tc+=1,Tc>=2&&Sf("down")}function y6(){Tc=0,oo==="down"&&Sf("up")}function Ai(e){J2=e;for(const n of Ac)n()}function k6(){return J2&&oo==="down"?"up":oo}function v6(e){return Ac.add(e),()=>Ac.delete(e)}const Pc="squad.console.token";let Rc=null;function dx(e){try{return e().getItem(Pc)}catch{return null}}function Bi(){return Rc??dx(()=>localStorage)??dx(()=>sessionStorage)}function j6(e){Rc=e;try{localStorage.setItem(Pc,e)}catch{}}function tk(e){Rc===e&&(Rc=null);for(const n of[()=>localStorage,()=>sessionStorage])try{n().getItem(Pc)===e&&n().removeItem(Pc)}catch{}}const gt=(()=>{const e=/^\/p\/([^/]+)/.exec(window.location.pathname);return e?decodeURIComponent(e[1]):null})(),zi=gt?`/p/${encodeURIComponent(gt)}`:"";function Co(e){return!zi||!e.startsWith("/api/")||e.startsWith("/api/v1/app/")?e:zi+e}function b6(){const e=new URL(window.location.href),n=e.searchParams.get("t");return n?(j6(n),e.searchParams.delete("t"),window.history.replaceState({},"",e.toString()),n):Bi()}class Ic extends Error{constructor(){super("This page's link is out of date. Run squad in a terminal: it opens the board with a fresh link."),this.name="UnauthorizedError"}}class ou extends Error{constructor(n,s){super(n),this.status=s,this.name="ApiError"}}function nk(e){return e instanceof Error&&(e.message===sk||e instanceof ou&&e.status>=500)}const sk="squad-kit did not answer, so nothing changed. Check that it still runs in its terminal, then try again.";async function rk(e,n){let s;try{s=await fetch(e,n)}catch{throw ek(),new Error(sk)}return x6(s.status),s}async function Ee(e,n){const s=Bi();if(!s)throw new Ic;const r=await rk(Co(e),{...n,headers:{"content-type":"application/json",authorization:`Bearer ${s}`}});if(r.status===401)throw tk(s),new Ic;if(!r.ok){const a=await w6(r);throw new Error(`${r.status} ${r.statusText}: ${a}`)}return await r.json()}async function w6(e){try{return(await e.text()).slice(0,400)}catch{return""}}async function bt(e,n,s={}){const r=Bi();if(!r)throw new Ic;const a=await rk(Co(e),{method:n,headers:{"content-type":"application/json",authorization:`Bearer ${r}`},body:JSON.stringify(s)});if(a.status===401)throw tk(r),new Ic;const o=await a.json().catch(()=>({}));if(!a.ok)throw new ou(o.error??`${a.status} ${a.statusText}`,a.status);return o}function yn(e,n){const s=Bi()??"";return`${Co(`/api/v1/tickets/${encodeURIComponent(e)}/file`)}?path=${encodeURIComponent(n.replace(/^file:\/\//,""))}&t=${encodeURIComponent(s)}`}function Cs(e){const n=Bi()??"";return`${Co(e)}?t=${encodeURIComponent(n)}`}/**
57
- * @license lucide-react v0.460.0 - ISC
58
- *
59
- * This source code is licensed under the ISC license.
60
- * See the LICENSE file in the root directory of this source tree.
61
- */const N6=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),ik=(...e)=>e.filter((n,s,r)=>!!n&&n.trim()!==""&&r.indexOf(n)===s).join(" ").trim();/**
62
- * @license lucide-react v0.460.0 - ISC
63
- *
64
- * This source code is licensed under the ISC license.
65
- * See the LICENSE file in the root directory of this source tree.
66
- */var S6={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
67
- * @license lucide-react v0.460.0 - ISC
68
- *
69
- * This source code is licensed under the ISC license.
70
- * See the LICENSE file in the root directory of this source tree.
71
- */const C6=$.forwardRef(({color:e="currentColor",size:n=24,strokeWidth:s=2,absoluteStrokeWidth:r,className:a="",children:o,iconNode:c,...u},d)=>$.createElement("svg",{ref:d,...S6,width:n,height:n,stroke:e,strokeWidth:r?Number(s)*24/Number(n):s,className:ik("lucide",a),...u},[...c.map(([p,f])=>$.createElement(p,f)),...Array.isArray(o)?o:[o]]));/**
72
- * @license lucide-react v0.460.0 - ISC
73
- *
74
- * This source code is licensed under the ISC license.
75
- * See the LICENSE file in the root directory of this source tree.
76
- */const ae=(e,n)=>{const s=$.forwardRef(({className:r,...a},o)=>$.createElement(C6,{ref:o,iconNode:n,className:ik(`lucide-${N6(e)}`,r),...a}));return s.displayName=`${e}`,s};/**
77
- * @license lucide-react v0.460.0 - ISC
78
- *
79
- * This source code is licensed under the ISC license.
80
- * See the LICENSE file in the root directory of this source tree.
81
- */const ak=ae("ArchiveRestore",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h2",key:"tvwodi"}],["path",{d:"M20 8v11a2 2 0 0 1-2 2h-2",key:"1gkqxj"}],["path",{d:"m9 15 3-3 3 3",key:"1pd0qc"}],["path",{d:"M12 12v9",key:"192myk"}]]);/**
82
- * @license lucide-react v0.460.0 - ISC
83
- *
84
- * This source code is licensed under the ISC license.
85
- * See the LICENSE file in the root directory of this source tree.
86
- */const zc=ae("Archive",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]]);/**
87
- * @license lucide-react v0.460.0 - ISC
88
- *
89
- * This source code is licensed under the ISC license.
90
- * See the LICENSE file in the root directory of this source tree.
91
- */const $6=ae("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/**
92
- * @license lucide-react v0.460.0 - ISC
93
- *
94
- * This source code is licensed under the ISC license.
95
- * See the LICENSE file in the root directory of this source tree.
96
- */const E6=ae("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
97
- * @license lucide-react v0.460.0 - ISC
98
- *
99
- * This source code is licensed under the ISC license.
100
- * See the LICENSE file in the root directory of this source tree.
101
- */const Mc=ae("ArrowRightLeft",[["path",{d:"m16 3 4 4-4 4",key:"1x1c3m"}],["path",{d:"M20 7H4",key:"zbl0bi"}],["path",{d:"m8 21-4-4 4-4",key:"h9nckh"}],["path",{d:"M4 17h16",key:"g4d7ey"}]]);/**
102
- * @license lucide-react v0.460.0 - ISC
103
- *
104
- * This source code is licensed under the ISC license.
105
- * See the LICENSE file in the root directory of this source tree.
106
- */const lo=ae("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
107
- * @license lucide-react v0.460.0 - ISC
108
- *
109
- * This source code is licensed under the ISC license.
110
- * See the LICENSE file in the root directory of this source tree.
111
- */const os=ae("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
112
- * @license lucide-react v0.460.0 - ISC
113
- *
114
- * This source code is licensed under the ISC license.
115
- * See the LICENSE file in the root directory of this source tree.
116
- */const Ep=ae("BellRing",[["path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9",key:"1qo2s2"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}],["path",{d:"M4 2C2.8 3.7 2 5.7 2 8",key:"tap9e0"}],["path",{d:"M22 8c0-2.3-.8-4.3-2-6",key:"5bb3ad"}]]);/**
117
- * @license lucide-react v0.460.0 - ISC
118
- *
119
- * This source code is licensed under the ISC license.
120
- * See the LICENSE file in the root directory of this source tree.
121
- */const ok=ae("Brain",[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z",key:"ep3f8r"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4",key:"1p4c4q"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}]]);/**
122
- * @license lucide-react v0.460.0 - ISC
123
- *
124
- * This source code is licensed under the ISC license.
125
- * See the LICENSE file in the root directory of this source tree.
126
- */const Ts=ae("Bug",[["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M9 7.13v-1a3.003 3.003 0 1 1 6 0v1",key:"d7y7pr"}],["path",{d:"M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6",key:"xs1cw7"}],["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M6.53 9C4.6 8.8 3 7.1 3 5",key:"32zzws"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"M3 21c0-2.1 1.7-3.9 3.8-4",key:"4p0ekp"}],["path",{d:"M20.97 5c0 2.1-1.6 3.8-3.5 4",key:"18gb23"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M17.2 17c2.1.1 3.8 1.9 3.8 4",key:"k3fwyw"}]]);/**
127
- * @license lucide-react v0.460.0 - ISC
128
- *
129
- * This source code is licensed under the ISC license.
130
- * See the LICENSE file in the root directory of this source tree.
131
- */const xe=ae("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
132
- * @license lucide-react v0.460.0 - ISC
133
- *
134
- * This source code is licensed under the ISC license.
135
- * See the LICENSE file in the root directory of this source tree.
136
- */const Cf=ae("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
137
- * @license lucide-react v0.460.0 - ISC
138
- *
139
- * This source code is licensed under the ISC license.
140
- * See the LICENSE file in the root directory of this source tree.
141
- */const lk=ae("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
142
- * @license lucide-react v0.460.0 - ISC
143
- *
144
- * This source code is licensed under the ISC license.
145
- * See the LICENSE file in the root directory of this source tree.
146
- */const lu=ae("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
147
- * @license lucide-react v0.460.0 - ISC
148
- *
149
- * This source code is licensed under the ISC license.
150
- * See the LICENSE file in the root directory of this source tree.
151
- */const ck=ae("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
152
- * @license lucide-react v0.460.0 - ISC
153
- *
154
- * This source code is licensed under the ISC license.
155
- * See the LICENSE file in the root directory of this source tree.
156
- */const T6=ae("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);/**
157
- * @license lucide-react v0.460.0 - ISC
158
- *
159
- * This source code is licensed under the ISC license.
160
- * See the LICENSE file in the root directory of this source tree.
161
- */const zr=ae("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
162
- * @license lucide-react v0.460.0 - ISC
163
- *
164
- * This source code is licensed under the ISC license.
165
- * See the LICENSE file in the root directory of this source tree.
166
- */const uk=ae("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
167
- * @license lucide-react v0.460.0 - ISC
168
- *
169
- * This source code is licensed under the ISC license.
170
- * See the LICENSE file in the root directory of this source tree.
171
- */const $o=ae("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);/**
172
- * @license lucide-react v0.460.0 - ISC
173
- *
174
- * This source code is licensed under the ISC license.
175
- * See the LICENSE file in the root directory of this source tree.
176
- */const dk=ae("Compass",[["path",{d:"m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z",key:"9ktpf1"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
177
- * @license lucide-react v0.460.0 - ISC
178
- *
179
- * This source code is licensed under the ISC license.
180
- * See the LICENSE file in the root directory of this source tree.
181
- */const ur=ae("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
182
- * @license lucide-react v0.460.0 - ISC
183
- *
184
- * This source code is licensed under the ISC license.
185
- * See the LICENSE file in the root directory of this source tree.
186
- */const A6=ae("CornerLeftUp",[["polyline",{points:"14 9 9 4 4 9",key:"m9oyvo"}],["path",{d:"M20 20h-7a4 4 0 0 1-4-4V4",key:"1blwi3"}]]);/**
187
- * @license lucide-react v0.460.0 - ISC
188
- *
189
- * This source code is licensed under the ISC license.
190
- * See the LICENSE file in the root directory of this source tree.
191
- */const ls=ae("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
192
- * @license lucide-react v0.460.0 - ISC
193
- *
194
- * This source code is licensed under the ISC license.
195
- * See the LICENSE file in the root directory of this source tree.
196
- */const hk=ae("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);/**
197
- * @license lucide-react v0.460.0 - ISC
198
- *
199
- * This source code is licensed under the ISC license.
200
- * See the LICENSE file in the root directory of this source tree.
201
- */const is=ae("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/**
202
- * @license lucide-react v0.460.0 - ISC
203
- *
204
- * This source code is licensed under the ISC license.
205
- * See the LICENSE file in the root directory of this source tree.
206
- */const pk=ae("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
207
- * @license lucide-react v0.460.0 - ISC
208
- *
209
- * This source code is licensed under the ISC license.
210
- * See the LICENSE file in the root directory of this source tree.
211
- */const fk=ae("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
212
- * @license lucide-react v0.460.0 - ISC
213
- *
214
- * This source code is licensed under the ISC license.
215
- * See the LICENSE file in the root directory of this source tree.
216
- */const mk=ae("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
217
- * @license lucide-react v0.460.0 - ISC
218
- *
219
- * This source code is licensed under the ISC license.
220
- * See the LICENSE file in the root directory of this source tree.
221
- */const P6=ae("FlaskConical",[["path",{d:"M10 2v7.527a2 2 0 0 1-.211.896L4.72 20.55a1 1 0 0 0 .9 1.45h12.76a1 1 0 0 0 .9-1.45l-5.069-10.127A2 2 0 0 1 14 9.527V2",key:"pzvekw"}],["path",{d:"M8.5 2h7",key:"csnxdl"}],["path",{d:"M7 16h10",key:"wp8him"}]]);/**
222
- * @license lucide-react v0.460.0 - ISC
223
- *
224
- * This source code is licensed under the ISC license.
225
- * See the LICENSE file in the root directory of this source tree.
226
- */const R6=ae("FolderCheck",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}],["path",{d:"m9 13 2 2 4-4",key:"6343dt"}]]);/**
227
- * @license lucide-react v0.460.0 - ISC
228
- *
229
- * This source code is licensed under the ISC license.
230
- * See the LICENSE file in the root directory of this source tree.
231
- */const I6=ae("FolderGit2",[["path",{d:"M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5",key:"1w6njk"}],["circle",{cx:"13",cy:"12",r:"2",key:"1j92g6"}],["path",{d:"M18 19c-2.8 0-5-2.2-5-5v8",key:"pkpw2h"}],["circle",{cx:"20",cy:"19",r:"2",key:"1obnsp"}]]);/**
232
- * @license lucide-react v0.460.0 - ISC
233
- *
234
- * This source code is licensed under the ISC license.
235
- * See the LICENSE file in the root directory of this source tree.
236
- */const gk=ae("FolderPlus",[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/**
237
- * @license lucide-react v0.460.0 - ISC
238
- *
239
- * This source code is licensed under the ISC license.
240
- * See the LICENSE file in the root directory of this source tree.
241
- */const z6=ae("Folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/**
242
- * @license lucide-react v0.460.0 - ISC
243
- *
244
- * This source code is licensed under the ISC license.
245
- * See the LICENSE file in the root directory of this source tree.
246
- */const Tp=ae("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);/**
247
- * @license lucide-react v0.460.0 - ISC
248
- *
249
- * This source code is licensed under the ISC license.
250
- * See the LICENSE file in the root directory of this source tree.
251
- */const xk=ae("GitMerge",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M6 21V9a9 9 0 0 0 9 9",key:"7kw0sc"}]]);/**
252
- * @license lucide-react v0.460.0 - ISC
253
- *
254
- * This source code is licensed under the ISC license.
255
- * See the LICENSE file in the root directory of this source tree.
256
- */const M6=ae("GitPullRequest",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M13 6h3a2 2 0 0 1 2 2v7",key:"1yeb86"}],["line",{x1:"6",x2:"6",y1:"9",y2:"21",key:"rroup"}]]);/**
257
- * @license lucide-react v0.460.0 - ISC
258
- *
259
- * This source code is licensed under the ISC license.
260
- * See the LICENSE file in the root directory of this source tree.
261
- */const F6=ae("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/**
262
- * @license lucide-react v0.460.0 - ISC
263
- *
264
- * This source code is licensed under the ISC license.
265
- * See the LICENSE file in the root directory of this source tree.
266
- */const L6=ae("HardDrive",[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]]);/**
267
- * @license lucide-react v0.460.0 - ISC
268
- *
269
- * This source code is licensed under the ISC license.
270
- * See the LICENSE file in the root directory of this source tree.
271
- */const Ap=ae("Hourglass",[["path",{d:"M5 22h14",key:"ehvnwv"}],["path",{d:"M5 2h14",key:"pdyrp9"}],["path",{d:"M17 22v-4.172a2 2 0 0 0-.586-1.414L12 12l-4.414 4.414A2 2 0 0 0 7 17.828V22",key:"1d314k"}],["path",{d:"M7 2v4.172a2 2 0 0 0 .586 1.414L12 12l4.414-4.414A2 2 0 0 0 17 6.172V2",key:"1vvvr6"}]]);/**
272
- * @license lucide-react v0.460.0 - ISC
273
- *
274
- * This source code is licensed under the ISC license.
275
- * See the LICENSE file in the root directory of this source tree.
276
- */const _6=ae("ImagePlus",[["path",{d:"M16 5h6",key:"1vod17"}],["path",{d:"M19 2v6",key:"4bpg5p"}],["path",{d:"M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5",key:"1ue2ih"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}]]);/**
277
- * @license lucide-react v0.460.0 - ISC
278
- *
279
- * This source code is licensed under the ISC license.
280
- * See the LICENSE file in the root directory of this source tree.
281
- */const O6=ae("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]]);/**
282
- * @license lucide-react v0.460.0 - ISC
283
- *
284
- * This source code is licensed under the ISC license.
285
- * See the LICENSE file in the root directory of this source tree.
286
- */const q6=ae("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
287
- * @license lucide-react v0.460.0 - ISC
288
- *
289
- * This source code is licensed under the ISC license.
290
- * See the LICENSE file in the root directory of this source tree.
291
- */const yk=ae("LayoutGrid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);/**
292
- * @license lucide-react v0.460.0 - ISC
293
- *
294
- * This source code is licensed under the ISC license.
295
- * See the LICENSE file in the root directory of this source tree.
296
- */const $f=ae("LifeBuoy",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.93 4.93 4.24 4.24",key:"1ymg45"}],["path",{d:"m14.83 9.17 4.24-4.24",key:"1cb5xl"}],["path",{d:"m14.83 14.83 4.24 4.24",key:"q42g0n"}],["path",{d:"m9.17 14.83-4.24 4.24",key:"bqpfvv"}],["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}]]);/**
297
- * @license lucide-react v0.460.0 - ISC
298
- *
299
- * This source code is licensed under the ISC license.
300
- * See the LICENSE file in the root directory of this source tree.
301
- */const D6=ae("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);/**
302
- * @license lucide-react v0.460.0 - ISC
303
- *
304
- * This source code is licensed under the ISC license.
305
- * See the LICENSE file in the root directory of this source tree.
306
- */const B6=ae("ListChecks",[["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]]);/**
307
- * @license lucide-react v0.460.0 - ISC
308
- *
309
- * This source code is licensed under the ISC license.
310
- * See the LICENSE file in the root directory of this source tree.
311
- */const W6=ae("ListTodo",[["rect",{x:"3",y:"5",width:"6",height:"6",rx:"1",key:"1defrl"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]]);/**
312
- * @license lucide-react v0.460.0 - ISC
313
- *
314
- * This source code is licensed under the ISC license.
315
- * See the LICENSE file in the root directory of this source tree.
316
- */const kk=ae("ListTree",[["path",{d:"M21 12h-8",key:"1bmf0i"}],["path",{d:"M21 6H8",key:"1pqkrb"}],["path",{d:"M21 18h-8",key:"1tm79t"}],["path",{d:"M3 6v4c0 1.1.9 2 2 2h3",key:"1ywdgy"}],["path",{d:"M3 10v6c0 1.1.9 2 2 2h3",key:"2wc746"}]]);/**
317
- * @license lucide-react v0.460.0 - ISC
318
- *
319
- * This source code is licensed under the ISC license.
320
- * See the LICENSE file in the root directory of this source tree.
321
- */const jn=ae("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
322
- * @license lucide-react v0.460.0 - ISC
323
- *
324
- * This source code is licensed under the ISC license.
325
- * See the LICENSE file in the root directory of this source tree.
326
- */const U6=ae("Map",[["path",{d:"M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z",key:"169xi5"}],["path",{d:"M15 5.764v15",key:"1pn4in"}],["path",{d:"M9 3.236v15",key:"1uimfh"}]]);/**
327
- * @license lucide-react v0.460.0 - ISC
328
- *
329
- * This source code is licensed under the ISC license.
330
- * See the LICENSE file in the root directory of this source tree.
331
- */const cu=ae("Maximize2",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/**
332
- * @license lucide-react v0.460.0 - ISC
333
- *
334
- * This source code is licensed under the ISC license.
335
- * See the LICENSE file in the root directory of this source tree.
336
- */const H6=ae("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/**
337
- * @license lucide-react v0.460.0 - ISC
338
- *
339
- * This source code is licensed under the ISC license.
340
- * See the LICENSE file in the root directory of this source tree.
341
- */const Pn=ae("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);/**
342
- * @license lucide-react v0.460.0 - ISC
343
- *
344
- * This source code is licensed under the ISC license.
345
- * See the LICENSE file in the root directory of this source tree.
346
- */const hx=ae("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/**
347
- * @license lucide-react v0.460.0 - ISC
348
- *
349
- * This source code is licensed under the ISC license.
350
- * See the LICENSE file in the root directory of this source tree.
351
- */const V6=ae("MessagesSquare",[["path",{d:"M14 9a2 2 0 0 1-2 2H6l-4 4V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2z",key:"p1xzt8"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v11l-4-4h-6a2 2 0 0 1-2-2v-1",key:"1cx29u"}]]);/**
352
- * @license lucide-react v0.460.0 - ISC
353
- *
354
- * This source code is licensed under the ISC license.
355
- * See the LICENSE file in the root directory of this source tree.
356
- */const px=ae("Mic",[["path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z",key:"131961"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}]]);/**
357
- * @license lucide-react v0.460.0 - ISC
358
- *
359
- * This source code is licensed under the ISC license.
360
- * See the LICENSE file in the root directory of this source tree.
361
- */const vk=ae("Minimize2",[["polyline",{points:"4 14 10 14 10 20",key:"11kfnr"}],["polyline",{points:"20 10 14 10 14 4",key:"rlmsce"}],["line",{x1:"14",x2:"21",y1:"10",y2:"3",key:"o5lafz"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/**
362
- * @license lucide-react v0.460.0 - ISC
363
- *
364
- * This source code is licensed under the ISC license.
365
- * See the LICENSE file in the root directory of this source tree.
366
- */const Eo=ae("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);/**
367
- * @license lucide-react v0.460.0 - ISC
368
- *
369
- * This source code is licensed under the ISC license.
370
- * See the LICENSE file in the root directory of this source tree.
371
- */const K6=ae("MonitorOff",[["path",{d:"M17 17H4a2 2 0 0 1-2-2V5c0-1.5 1-2 1-2",key:"k0q8oc"}],["path",{d:"M22 15V5a2 2 0 0 0-2-2H9",key:"cp1ac0"}],["path",{d:"M8 21h8",key:"1ev6f3"}],["path",{d:"M12 17v4",key:"1riwvh"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
372
- * @license lucide-react v0.460.0 - ISC
373
- *
374
- * This source code is licensed under the ISC license.
375
- * See the LICENSE file in the root directory of this source tree.
376
- */const To=ae("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
377
- * @license lucide-react v0.460.0 - ISC
378
- *
379
- * This source code is licensed under the ISC license.
380
- * See the LICENSE file in the root directory of this source tree.
381
- */const Y6=ae("Network",[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]]);/**
382
- * @license lucide-react v0.460.0 - ISC
383
- *
384
- * This source code is licensed under the ISC license.
385
- * See the LICENSE file in the root directory of this source tree.
386
- */const Fc=ae("Paperclip",[["path",{d:"m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48",key:"1u3ebp"}]]);/**
387
- * @license lucide-react v0.460.0 - ISC
388
- *
389
- * This source code is licensed under the ISC license.
390
- * See the LICENSE file in the root directory of this source tree.
391
- */const uu=ae("Pause",[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]]);/**
392
- * @license lucide-react v0.460.0 - ISC
393
- *
394
- * This source code is licensed under the ISC license.
395
- * See the LICENSE file in the root directory of this source tree.
396
- */const co=ae("PenLine",[["path",{d:"M12 20h9",key:"t2du7b"}],["path",{d:"M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z",key:"1ykcvy"}]]);/**
397
- * @license lucide-react v0.460.0 - ISC
398
- *
399
- * This source code is licensed under the ISC license.
400
- * See the LICENSE file in the root directory of this source tree.
401
- */const cs=ae("PencilLine",[["path",{d:"M12 20h9",key:"t2du7b"}],["path",{d:"M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z",key:"1ykcvy"}],["path",{d:"m15 5 3 3",key:"1w25hb"}]]);/**
402
- * @license lucide-react v0.460.0 - ISC
403
- *
404
- * This source code is licensed under the ISC license.
405
- * See the LICENSE file in the root directory of this source tree.
406
- */const Lc=ae("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/**
407
- * @license lucide-react v0.460.0 - ISC
408
- *
409
- * This source code is licensed under the ISC license.
410
- * See the LICENSE file in the root directory of this source tree.
411
- */const Wi=ae("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
412
- * @license lucide-react v0.460.0 - ISC
413
- *
414
- * This source code is licensed under the ISC license.
415
- * See the LICENSE file in the root directory of this source tree.
416
- */const Q6=ae("Plug",[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M9 8V2",key:"14iosj"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8Z",key:"osxo6l"}]]);/**
417
- * @license lucide-react v0.460.0 - ISC
418
- *
419
- * This source code is licensed under the ISC license.
420
- * See the LICENSE file in the root directory of this source tree.
421
- */const Tt=ae("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
422
- * @license lucide-react v0.460.0 - ISC
423
- *
424
- * This source code is licensed under the ISC license.
425
- * See the LICENSE file in the root directory of this source tree.
426
- */const Mi=ae("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
427
- * @license lucide-react v0.460.0 - ISC
428
- *
429
- * This source code is licensed under the ISC license.
430
- * See the LICENSE file in the root directory of this source tree.
431
- */const G6=ae("Reply",[["polyline",{points:"9 17 4 12 9 7",key:"hvgpf2"}],["path",{d:"M20 18v-2a4 4 0 0 0-4-4H4",key:"5vmcpk"}]]);/**
432
- * @license lucide-react v0.460.0 - ISC
433
- *
434
- * This source code is licensed under the ISC license.
435
- * See the LICENSE file in the root directory of this source tree.
436
- */const Va=ae("Rocket",[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]]);/**
437
- * @license lucide-react v0.460.0 - ISC
438
- *
439
- * This source code is licensed under the ISC license.
440
- * See the LICENSE file in the root directory of this source tree.
441
- */const qr=ae("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/**
442
- * @license lucide-react v0.460.0 - ISC
443
- *
444
- * This source code is licensed under the ISC license.
445
- * See the LICENSE file in the root directory of this source tree.
446
- */const Ui=ae("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
447
- * @license lucide-react v0.460.0 - ISC
448
- *
449
- * This source code is licensed under the ISC license.
450
- * See the LICENSE file in the root directory of this source tree.
451
- */const hs=ae("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);/**
452
- * @license lucide-react v0.460.0 - ISC
453
- *
454
- * This source code is licensed under the ISC license.
455
- * See the LICENSE file in the root directory of this source tree.
456
- */const Z6=ae("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
457
- * @license lucide-react v0.460.0 - ISC
458
- *
459
- * This source code is licensed under the ISC license.
460
- * See the LICENSE file in the root directory of this source tree.
461
- */const X6=ae("Shapes",[["path",{d:"M8.3 10a.7.7 0 0 1-.626-1.079L11.4 3a.7.7 0 0 1 1.198-.043L16.3 8.9a.7.7 0 0 1-.572 1.1Z",key:"1bo67w"}],["rect",{x:"3",y:"14",width:"7",height:"7",rx:"1",key:"1bkyp8"}],["circle",{cx:"17.5",cy:"17.5",r:"3.5",key:"w3z12y"}]]);/**
462
- * @license lucide-react v0.460.0 - ISC
463
- *
464
- * This source code is licensed under the ISC license.
465
- * See the LICENSE file in the root directory of this source tree.
466
- */const jk=ae("ShieldAlert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]);/**
467
- * @license lucide-react v0.460.0 - ISC
468
- *
469
- * This source code is licensed under the ISC license.
470
- * See the LICENSE file in the root directory of this source tree.
471
- */const fx=ae("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
472
- * @license lucide-react v0.460.0 - ISC
473
- *
474
- * This source code is licensed under the ISC license.
475
- * See the LICENSE file in the root directory of this source tree.
476
- */const mx=ae("ShieldOff",[["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M5 5a1 1 0 0 0-1 1v7c0 5 3.5 7.5 7.67 8.94a1 1 0 0 0 .67.01c2.35-.82 4.48-1.97 5.9-3.71",key:"1jlk70"}],["path",{d:"M9.309 3.652A12.252 12.252 0 0 0 11.24 2.28a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1v7a9.784 9.784 0 0 1-.08 1.264",key:"18rp1v"}]]);/**
477
- * @license lucide-react v0.460.0 - ISC
478
- *
479
- * This source code is licensed under the ISC license.
480
- * See the LICENSE file in the root directory of this source tree.
481
- */const Ph=ae("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/**
482
- * @license lucide-react v0.460.0 - ISC
483
- *
484
- * This source code is licensed under the ISC license.
485
- * See the LICENSE file in the root directory of this source tree.
486
- */const bk=ae("SquareCheck",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
487
- * @license lucide-react v0.460.0 - ISC
488
- *
489
- * This source code is licensed under the ISC license.
490
- * See the LICENSE file in the root directory of this source tree.
491
- */const gx=ae("SquarePlus",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]]);/**
492
- * @license lucide-react v0.460.0 - ISC
493
- *
494
- * This source code is licensed under the ISC license.
495
- * See the LICENSE file in the root directory of this source tree.
496
- */const us=ae("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
497
- * @license lucide-react v0.460.0 - ISC
498
- *
499
- * This source code is licensed under the ISC license.
500
- * See the LICENSE file in the root directory of this source tree.
501
- */const Ao=ae("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/**
502
- * @license lucide-react v0.460.0 - ISC
503
- *
504
- * This source code is licensed under the ISC license.
505
- * See the LICENSE file in the root directory of this source tree.
506
- */const _c=ae("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/**
507
- * @license lucide-react v0.460.0 - ISC
508
- *
509
- * This source code is licensed under the ISC license.
510
- * See the LICENSE file in the root directory of this source tree.
511
- */const vn=ae("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
512
- * @license lucide-react v0.460.0 - ISC
513
- *
514
- * This source code is licensed under the ISC license.
515
- * See the LICENSE file in the root directory of this source tree.
516
- */const dr=ae("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
517
- * @license lucide-react v0.460.0 - ISC
518
- *
519
- * This source code is licensed under the ISC license.
520
- * See the LICENSE file in the root directory of this source tree.
521
- */const J6=ae("Triangle",[["path",{d:"M13.73 4a2 2 0 0 0-3.46 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z",key:"14u9p9"}]]);/**
522
- * @license lucide-react v0.460.0 - ISC
523
- *
524
- * This source code is licensed under the ISC license.
525
- * See the LICENSE file in the root directory of this source tree.
526
- */const e8=ae("Undo2",[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]);/**
527
- * @license lucide-react v0.460.0 - ISC
528
- *
529
- * This source code is licensed under the ISC license.
530
- * See the LICENSE file in the root directory of this source tree.
531
- */const t8=ae("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/**
532
- * @license lucide-react v0.460.0 - ISC
533
- *
534
- * This source code is licensed under the ISC license.
535
- * See the LICENSE file in the root directory of this source tree.
536
- */const wk=ae("UserRound",[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]]);/**
537
- * @license lucide-react v0.460.0 - ISC
538
- *
539
- * This source code is licensed under the ISC license.
540
- * See the LICENSE file in the root directory of this source tree.
541
- */const n8=ae("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/**
542
- * @license lucide-react v0.460.0 - ISC
543
- *
544
- * This source code is licensed under the ISC license.
545
- * See the LICENSE file in the root directory of this source tree.
546
- */const Nk=ae("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/**
547
- * @license lucide-react v0.460.0 - ISC
548
- *
549
- * This source code is licensed under the ISC license.
550
- * See the LICENSE file in the root directory of this source tree.
551
- */const Sk=ae("Wallet",[["path",{d:"M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1",key:"18etb6"}],["path",{d:"M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4",key:"xoc0q4"}]]);/**
552
- * @license lucide-react v0.460.0 - ISC
553
- *
554
- * This source code is licensed under the ISC license.
555
- * See the LICENSE file in the root directory of this source tree.
556
- */const Pp=ae("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);/**
557
- * @license lucide-react v0.460.0 - ISC
558
- *
559
- * This source code is licensed under the ISC license.
560
- * See the LICENSE file in the root directory of this source tree.
561
- */const Xe=ae("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function s8(e){return e==="err"?null:3200}function r8(e,n){return n.kind==="err"&&e.some(s=>s.kind==="err"&&s.text===n.text)?e:[...e,n]}let Ck=null;const Rp=new Set;function xx(e){Ck=e;for(const n of Rp)n()}const Po={open:(e={})=>xx(e),close:()=>xx(null)};function i8(){return $.useSyncExternalStore(e=>(Rp.add(e),()=>Rp.delete(e)),()=>Ck)}const $k=$.createContext(null);function Ip(e){try{return localStorage.getItem(e)}catch{return null}}function Rh(e,n){try{localStorage.setItem(e,n)}catch{}}function Ek(){const e=Ip("sk.theme");return e==="light"||e==="dark"?e:window.matchMedia?.("(prefers-color-scheme: dark)").matches?"dark":"light"}function yx({children:e}){const[n,s]=$.useState(Ek),[r,a]=$.useState(Ip("sk.commands")!=="off"),[o,c]=$.useState(Ip("sk.ticketFull")==="on"),[u,d]=$.useState([]);$.useEffect(()=>{document.documentElement.dataset.theme=n,Rh("sk.theme",n)},[n]);const p=$.useCallback(y=>d(x=>x.filter(k=>k.id!==y)),[]),f=$.useCallback((y,x="ok",k)=>{const v=Date.now()+Math.random();d(N=>r8(N,{id:v,text:y,kind:x,...k?{retry:k}:{}}));const b=s8(x);b!==null&&setTimeout(()=>p(v),b)},[p]),m=$.useMemo(()=>({theme:n,toggleTheme:()=>s(y=>y==="light"?"dark":"light"),showCommands:r,toggleCommands:()=>a(y=>(Rh("sk.commands",y?"off":"on"),!y)),ticketFull:o,toggleTicketFull:()=>c(y=>(Rh("sk.ticketFull",y?"off":"on"),!y)),toast:f}),[n,r,o,f]);return t.jsxs($k.Provider,{value:m,children:[e,t.jsx("div",{className:"toasts",role:"status","aria-live":"polite",children:u.map(y=>y.kind==="err"?t.jsxs("div",{className:"toast err",role:"alert",children:[t.jsx(zr,{size:16}),t.jsx("span",{className:"grow",children:y.text}),y.retry&&t.jsx("button",{className:"toast-act",onClick:()=>{p(y.id),y.retry()},children:"Try again"}),t.jsx("button",{className:"toast-act",onClick:()=>{p(y.id),Po.open()},children:"Report a problem"}),t.jsx("button",{className:"toast-x",onClick:()=>p(y.id),"aria-label":"Close this message",children:t.jsx(Xe,{size:15})})]},y.id):t.jsxs("div",{className:"toast",children:[t.jsx(xe,{size:16}),y.text]},y.id))})]})}function qe(){const e=$.useContext($k);if(!e)throw new Error("usePrefs outside PrefsProvider");return e}const Tk=900;function Qe(){return Pe({queryKey:["board"],queryFn:()=>Ee("/api/v1/board"),refetchInterval:Tk})}function Ro(e){return Pe({queryKey:["ticket",e],queryFn:()=>Ee(`/api/v1/tickets/${e}`),enabled:!!e,refetchInterval:Tk})}function a8(){return Pe({queryKey:["releases"],queryFn:()=>Ee("/api/v1/releases"),refetchInterval:2e3})}function o8(){return Pe({queryKey:["apps"],queryFn:()=>Ee("/api/v1/apps"),refetchInterval:e=>e.state.data?.apps.some(n=>n.state==="starting")||e.state.data?.reading?1e3:5e3})}function Ak(){return Pe({queryKey:["app","settings"],queryFn:()=>Ee("/api/v1/app/settings"),refetchInterval:5e3})}function l8(){return Pe({queryKey:["architecture"],queryFn:()=>Ee("/api/v1/architecture"),refetchInterval:2e3})}function pe(){const e=zn(),{toast:n}=qe(),s=$2({mutationFn:({path:r,body:a,method:o="POST"})=>bt(r,o,a),onSuccess:(r,a)=>{e.invalidateQueries(),a.done&&n(a.done)},onError:(r,a)=>n(r instanceof Error?r.message:String(r),"err",nk(r)?()=>s.mutate(a):void 0)});return s}function Pk(){const{toast:e}=qe(),[n,s]=$.useState(!1);return{restarting:n,restart:async()=>{s(!0),Ai(!0);const a=await fetch("/healthz").then(c=>c.json()).catch(()=>({startedAt:void 0}));try{await bt("/api/v1/restart","POST")}catch(c){s(!1),Ai(!1),e(c instanceof Error?c.message:String(c),"err");return}const o=Date.now()+9e4;for(;Date.now()<o;){await new Promise(u=>setTimeout(u,1e3));const c=await fetch("/healthz").then(u=>u.json()).catch(()=>null);if(c?.startedAt&&c.startedAt!==a.startedAt){window.location.reload();return}}s(!1),Ai(!1),e("The board did not come back. Run squad console in your terminal.","err")}}}function c8(){const{restarting:e,restart:n}=Pk();return t.jsxs("div",{className:"updatebar",role:"status",children:[t.jsx(Mi,{size:15}),t.jsxs("span",{children:[t.jsx("b",{children:"squad-kit was updated."})," Restart the board to use the new version. Running work picks up where it stopped."]}),t.jsx("span",{className:"grow"}),t.jsx("button",{className:"btn sm pri",disabled:e,onClick:()=>void n(),children:e?"Restarting…":"Restart now"})]})}function u8(e,n){const s=e instanceof Error?e.message:String(e);return/^404\b/.test(s)?`There is no ticket ${n} on this board. It may have been deleted.`:s}function d8(e,n=/win/i.test(typeof navigator>"u"?"":navigator.platform)&&!/darwin/i.test(navigator.platform)){return n||/^sudo\b/.test(e)?e:`sudo ${e}`}const $s={analyst:"Analyst",architect:"Architect",spec:"Spec writer",builder:"Builder",tester:"Tester",reviewer:"Reviewer",release:"Release",triage:"Triage",you:"You",squad:"Squad"},h8={analyst:Ui,architect:J6,spec:co,builder:$o,tester:bk,reviewer:fk,release:os,triage:Ts,you:n8,squad:Nk};function Hr({role:e,small:n,size:s}){const r=h8[e];return t.jsx("span",{className:`glyph ${n?"sm":""} ${e==="you"?"you":""}`,title:$s[e],children:t.jsx(r,{size:s??(n?12:14),strokeWidth:2})})}function se({text:e,keep:n}){const{showCommands:s,toast:r}=qe();if(!s)return null;const a=()=>{navigator.clipboard?.writeText(e).then(()=>r("Command copied"),()=>r("Could not copy. Select the text instead.","err"))},o=n&&e.endsWith(n)&&e.length>n.length?e.length-n.length:0;return t.jsxs("span",{className:"term",title:"The same action in the terminal",children:[t.jsx("b",{children:">_"}),o?t.jsxs(t.Fragment,{children:[t.jsx("span",{children:e.slice(0,o).trimEnd()}),t.jsx("span",{className:"term-keep",children:n})]}):t.jsx("span",{children:e}),t.jsx("button",{onClick:a,"aria-label":`Copy ${e}`,children:t.jsx(ur,{size:13})})]})}const Ih=[{stage:"tickets",name:"Tickets"},{stage:"specs",name:"Specs"},{stage:"implement",name:"Implement"},{stage:"test",name:"Test"},{stage:"review",name:"Review"},{stage:"release",name:"Release"}];function p8({ticket:e}){const n=e.stage==="bugs"?"tickets":e.stage,s=n==="done"?Ih.length:Ih.findIndex(o=>o.stage===n),r=e.waiting?"you":"work",a=new Map((e.now?.stages??[]).map(o=>[o.stage,o.note]));return t.jsx("div",{className:"track","aria-label":"Where this ticket is",children:Ih.map((o,c)=>{const u=c<s?"done":c===s?`cur ${r}`:"",d=a.get(o.stage);return t.jsxs("div",{className:`ts ${u}`,children:[t.jsx("span",{className:"nd",children:c<s?t.jsx(xe,{size:12,strokeWidth:3}):null}),o.name,c===s&&t.jsx("span",{className:"tag",children:r==="you"?"Your turn":e.stage==="release"?"Ready":e.dependency?.way==="wait"&&!e.dependency.started&&!e.squad?"Waiting":"Working"}),a.size>0&&t.jsx("span",{className:"tnote",children:c===s&&d==="your turn"?"":d??""})]},o.stage)})})}function Ve({title:e,onClose:n,children:s,footer:r,icon:a,wide:o,losing:c}){const[u,d]=$.useState(!1),p=$.useCallback(()=>c?d(!0):n(),[c,n]);return $.useEffect(()=>{const f=m=>m.key==="Escape"&&p();return window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f)},[p]),t.jsx("div",{className:"modal-veil",onMouseDown:f=>f.target===f.currentTarget&&p(),children:t.jsxs("div",{className:`modal ${o?"wide":""}`,role:"dialog","aria-modal":"true","aria-label":e,children:[t.jsxs("header",{children:[a,t.jsx("h3",{children:e}),t.jsx("span",{className:"grow"}),t.jsx("button",{className:"iconbtn",onClick:p,"aria-label":"Close",children:t.jsx(Xe,{size:16})})]}),t.jsx("div",{className:"mb",children:s}),u?t.jsxs("footer",{role:"alertdialog","aria-label":"Close this window?",children:[t.jsxs("span",{className:"grow",children:["Close and lose ",c,"? What you typed stays as a draft."]}),t.jsx("button",{className:"btn pri",autoFocus:!0,onClick:()=>d(!1),children:"Keep working"}),t.jsx("button",{className:"btn",onClick:n,children:"Close"})]}):r&&t.jsx("footer",{children:r})]})})}function Rk({onClear:e}){return t.jsxs("span",{className:"note draftnote",children:["Kept as a draft on this computer."," ",t.jsx("button",{type:"button",className:"linkbtn",onClick:e,children:"Clear"})]})}function Rn(e){return new Date(e).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",hour12:!1})}function Rs(e){return e?new Date(e).toLocaleDateString([],{day:"numeric",month:"short"}):""}function nn(e){const n=Math.max(0,(Date.now()-Date.parse(e))/1e3);return n<60?"just now":n<3600?`${Math.round(n/60)} min ago`:n<86400?`${Math.round(n/3600)} h ago`:Rs(e)}function kx({text:e}){const n=e.split(/(\*\*[^*]+\*\*)/g);return t.jsx(t.Fragment,{children:n.map((s,r)=>s.startsWith("**")?t.jsx("strong",{children:s.slice(2,-2)},r):t.jsx("span",{children:s},r))})}function f8({notes:e}){return t.jsx("div",{className:"notes",children:e.split(`
562
- `).map((n,s)=>n.startsWith("### ")?t.jsx("h4",{children:n.slice(4)},s):n.startsWith("- ")?t.jsxs("p",{children:["• ",t.jsx(kx,{text:n.slice(2)})]},s):n.trim()?t.jsx("p",{children:t.jsx(kx,{text:n})},s):null)})}function Ef(e){switch(e.waiting?.kind){case"questions":return`squad answer ${e.id}`;case"stuck":return`squad decide ${e.id}`;case"ask":return`squad reply ${e.id}`;case"yours":return`squad give-back ${e.id}`;case"chat":return`squad chat ${e.id}`;case"depends":return`squad build ${e.id} --on-branch`;case"change":case"spec":case"plan":case"proof":return`squad approve ${e.id}`;default:return`squad watch ${e.id}`}}function Tf(e){const n=e.outdated??[];return n.length===1?`${n[0].adr} came after this plan and changes it`:`${n.map(s=>s.adr).join(" and ")} came after this plan and change it`}function Oc(e){switch(e.waiting?.kind){case"questions":return"Answer";case"spec":return"Review spec";case"plan":return e.specApproved?"Review design":"Review plan";case"proof":return"Check proof";case"stuck":return"Decide";case"ask":return"Answer";case"yours":return"Give back";case"chat":return"Open chat";case"change":return"Review design update";case"depends":return"Choose";default:return"Open"}}const As={tickets:"Tickets",specs:"Specs",implement:"Implement",test:"Test",review:"Review",release:"Release",bugs:"Bugs",done:"Released"},Ik=["app","update"],du=["waiting","installing","restarting"],m8=2*6e4;function hu(){const e=Pe({queryKey:Ik,queryFn:()=>Ee("/api/v1/app/update"),refetchInterval:r=>du.includes(r.state.data?.progress.state??"idle")?1e3:6e4}),n=$.useRef(null),s=e.data?.startedAt;return $.useEffect(()=>{s&&(n.current&&n.current!==s&&window.location.reload(),n.current??=s)},[s]),e}function Io(){const e=zn(),{toast:n}=qe(),[s,r]=$.useState(!1);return{pending:s,call:async(o,c,u={})=>{r(!0);try{const d=await bt(o,c,u);return e.setQueryData(Ik,d),d}catch(d){return n(d instanceof Error?d.message:String(d),"err"),null}finally{r(!1)}}}}function zp(e=[]){const n=[...new Set(e.map(s=>s.ticket??`the Architect in ${s.project}`))];return n.length<=1?n[0]??"":n.length<=3?`${n.slice(0,-1).join(", ")} and ${n[n.length-1]}`:`${n.slice(0,2).join(", ")} and ${n.length-2} more`}function g8(e){const n=new Date(e),s=o=>o.toDateString(),r=new Date(Date.now()-864e5);return`${s(n)===s(new Date)?"Today":s(n)===s(r)?"Yesterday":n.toLocaleDateString([],{day:"numeric",month:"short"})} at ${Rn(e)}`}function Af({text:e}){const{toast:n}=qe(),s=()=>{const r=navigator.clipboard?.writeText(e);if(!r)return n("Could not copy. Select the text instead.","err");r.then(()=>n("Command copied"),()=>n("Could not copy. Select the text instead.","err"))};return t.jsxs("div",{className:"upd-cmd",children:[t.jsxs("span",{className:"term",children:[t.jsx("b",{children:">_"}),t.jsx("span",{children:e})]}),t.jsxs("button",{className:"btn sm",onClick:s,children:[t.jsx(ur,{size:13})," Copy"]})]})}const x8=3;function zk({s:e}){const n=e.releases?.length?e.releases:e.notes?.length?[{version:e.latest??e.current,lines:e.notes,url:e.notesUrl}]:[];if(!n.length)return null;if(n.length===1)return t.jsx("ul",{className:"upd-notes","aria-label":"What is new",children:n[0].lines.slice(0,3).map(a=>t.jsx("li",{children:a},a))});const s=n.slice(0,x8),r=n.length-s.length;return t.jsxs("div",{className:"upd-rels","aria-label":"What is new",children:[s.map(a=>t.jsxs("div",{className:"upd-rel",children:[t.jsx("a",{className:"upd-ver",href:a.url,target:"_blank",rel:"noreferrer",title:`What is new in ${a.version}`,children:a.version}),t.jsx("ul",{className:"upd-notes",children:a.lines.slice(0,3).map(o=>t.jsx("li",{children:o},o))})]},a.version)),r>0&&t.jsxs("a",{className:"upd-more",href:e.notesUrl,target:"_blank",rel:"noreferrer",children:["And ",r," older ",r===1?"release":"releases"]})]})}function y8(e){const n=e.progress.state;return du.includes(n)?`Updating to ${e.progress.to}`:n==="done"?`On ${e.current} now`:n==="failed"?"Update needs you":!e.newer||!e.latest||e.later===e.latest?null:`${e.latest} is ready`}function Mk(){const{data:e}=hu();if(!e)return null;const n=e.progress.state;return du.includes(n)?t.jsx(v8,{s:e}):n==="done"?t.jsx(j8,{s:e}):n==="failed"?t.jsx(b8,{s:e}):!e.newer||!e.latest||e.later===e.latest?null:t.jsx(k8,{s:e})}function k8({s:e}){const{pending:n,call:s}=Io(),r=e.devInstall||e.major;return t.jsxs("section",{className:"upd","aria-label":"A new squad-kit",children:[t.jsx("span",{className:"upd-ic",children:t.jsx(os,{size:16})}),t.jsxs("div",{className:"upd-main",children:[t.jsxs("b",{className:"upd-title",children:["squad-kit ",e.latest," is ready"]}),t.jsx(zk,{s:e}),t.jsx("span",{className:"upd-sub",children:e.devInstall?"This squad-kit runs from its source folder, so it does not update itself. To use the new version, run:":e.major?`A big change from ${e.current}. Read what is new first, then run this in a terminal:`:`You have ${e.current}. Takes about a minute. Your tickets and work are kept.`}),r&&t.jsx(Af,{text:e.command})]}),t.jsxs("div",{className:"upd-acts",children:[!r&&t.jsxs("button",{className:"btn sm pri",disabled:n,onClick:()=>void s("/api/v1/app/update","POST"),children:[t.jsx(os,{size:14})," Update now"]}),(!(e.notes?.length||e.releases?.length)||r)&&t.jsx("a",{className:"btn sm",href:e.notesUrl,target:"_blank",rel:"noreferrer",children:"What is new"}),t.jsx("button",{className:"btn sm",disabled:n,onClick:()=>void s("/api/v1/app/update","PUT",{later:e.latest}),children:"Later"}),!r&&t.jsx(se,{text:"squad upgrade"})]})]})}function v8({s:e}){const n=e.progress;$.useEffect(()=>{if(n.state!=="restarting")return;Ai(!0);const p=window.setTimeout(()=>Ai(!1),m8);return()=>{window.clearTimeout(p),Ai(!1)}},[n.state]);const{pending:s,call:r}=Io(),a=du.indexOf(n.state),o=p=>p<a?"done":p===a?"now":"todo",c=n.now?"Stopped the running steps":n.waitedFor?.length?`Waited for ${zp(n.waitedFor)} to finish ${n.waitedFor.length===1?"its step":"their steps"}`:"No work was in the middle of a step",u=n.busy?.length?`${zp(n.busy)} ${n.busy.length===1?"is":"are"} in the middle of a step`:"Almost there",d=[{label:a>0?c:"Waiting for running work to reach a safe point",note:a===0?u:n.now?"They pick up again after the restart":"Nothing was cut off"},{label:a>1?`Installed squad-kit ${n.to}`:`Installing squad-kit ${n.to}`,note:a===1?"Takes about a minute":a>1?"Done":"Next"},{label:"Restarting the app",note:a===2?"This page reloads on its own":"Same link, same tickets"},{label:"Picking up where each ticket was",note:"Nothing is lost"}];return t.jsxs("section",{className:"upd steps","aria-label":`Updating to squad-kit ${n.to}`,"aria-live":"polite",children:[t.jsxs("div",{className:"upd-head",children:[t.jsxs("b",{className:"upd-title",children:["Updating to squad-kit ",n.to]}),t.jsx("span",{className:"upd-sub",children:n.state==="waiting"?"squad-kit waits until no agent is in the middle of a step, so no work is cut off.":"Takes about a minute. Your tickets and work are kept."}),n.state==="waiting"&&t.jsxs("span",{className:"upd-acts",children:[t.jsx("button",{className:"btn sm pri",disabled:s,onClick:()=>void r("/api/v1/app/update","POST",{now:!0}),title:"Running steps stop now and pick up again after the restart",children:"Update now anyway"}),t.jsx("button",{className:"btn sm",disabled:s,onClick:()=>void r("/api/v1/app/update","DELETE"),children:"Not now"})]})]}),t.jsx("ol",{className:"setup-steps",children:d.map((p,f)=>t.jsxs("li",{className:o(f),children:[t.jsx("span",{className:"mark",children:o(f)==="done"?t.jsx(xe,{size:12,strokeWidth:3}):o(f)==="now"?t.jsx("span",{className:"live"}):null}),t.jsxs("span",{className:"txt",children:[t.jsx("b",{children:p.label}),t.jsx("small",{title:p.note,children:p.note})]})]},p.label))}),t.jsx("div",{className:"setup-bar","aria-hidden":!0,children:t.jsx("i",{})})]})}function j8({s:e}){const{pending:n,call:s}=Io(),r=e.progress.carried??[];return t.jsxs("section",{className:"upd","aria-label":`You are on squad-kit ${e.current}`,children:[t.jsx("span",{className:"upd-ic ok",children:t.jsx(xe,{size:16,strokeWidth:2.6})}),t.jsxs("div",{className:"upd-main",children:[t.jsxs("b",{className:"upd-title",children:["You are on squad-kit ",e.current]}),t.jsx("span",{className:"upd-sub",children:r.length?`${zp(r)} carried on where ${r.length===1?"it was":"they were"}. Nothing was lost.`:"Your tickets and work are kept."}),t.jsx(zk,{s:e})]}),t.jsxs("div",{className:"upd-acts",children:[t.jsx("a",{className:"btn sm",href:e.notesUrl,target:"_blank",rel:"noreferrer",children:"Read what is new"}),t.jsx("button",{className:"btn sm",disabled:n,onClick:()=>void s("/api/v1/app/update","DELETE"),children:"Close"})]})]})}function b8({s:e}){const n=e.progress,{pending:s,call:r}=Io();return t.jsxs("section",{className:"upd failed",role:"alert","aria-label":"squad-kit could not update by itself",children:[t.jsx("span",{className:"upd-ic",children:t.jsx(q6,{size:16})}),t.jsxs("div",{className:"upd-main",children:[t.jsx("b",{className:"upd-title",children:"Could not update by itself"}),t.jsxs("span",{className:"upd-sub",children:[n.reason," ",n.permission?"Run this once in a terminal, then press Restart:":"Try again, or run this in a terminal, then press Restart:"]}),t.jsx(Af,{text:n.permission?d8(e.command):e.command}),n.output&&t.jsxs("details",{className:"upd-out",children:[t.jsx("summary",{children:"What the installer said"}),t.jsx("pre",{children:n.output})]})]}),t.jsxs("div",{className:"upd-acts",children:[t.jsxs("button",{className:"btn sm pri",disabled:s,onClick:()=>void r("/api/v1/app/update/restart","POST"),children:[t.jsx(Mi,{size:14})," Restart"]}),!n.permission&&t.jsx("button",{className:"btn sm",disabled:s,onClick:()=>void r("/api/v1/app/update","POST"),children:"Try again"}),t.jsx("button",{className:"btn sm",disabled:s,onClick:()=>void r("/api/v1/app/update","DELETE"),children:"Not now"})]})]})}function Fk(){const{data:e}=hu(),{pending:n,call:s}=Io(),{toast:r}=qe();if(!e)return null;const a=async()=>{const c=await s("/api/v1/app/update/check","POST");c&&(c.checkError?r(c.checkError,"err"):r(c.newer?`squad-kit ${c.latest} is ready`:`You are on the latest version (${c.current})`))},o=e.newer&&!e.devInstall&&!e.major&&e.progress.state==="idle";return t.jsxs("div",{className:"about",children:[t.jsxs("div",{className:"maprow",style:{alignItems:"center"},children:[t.jsx("b",{children:"Version"}),t.jsxs("span",{className:"about-row",children:[t.jsx("b",{children:e.current}),e.newer?t.jsxs("span",{className:"pill you",children:[e.latest," is ready"]}):e.checkedAt&&!e.checkError?t.jsx("span",{className:"pill ok",children:"Up to date"}):null,e.devInstall&&t.jsx("span",{className:"pill",children:"Source folder"})]})]}),t.jsxs("div",{className:"maprow",style:{alignItems:"center"},children:[t.jsx("b",{children:"Last checked"}),t.jsxs("span",{className:"about-row",children:[e.checkedAt?g8(e.checkedAt):"Not yet",e.checkError&&t.jsx("span",{className:"note bad",children:e.checkError})]})]}),t.jsxs("div",{className:"maprow",style:{alignItems:"center"},children:[t.jsx("b",{children:"Updates"}),t.jsxs("span",{className:"about-row",children:[t.jsxs("label",{className:"about-daily",children:[t.jsx("input",{type:"checkbox",checked:e.daily,disabled:n,onChange:c=>void s("/api/v1/app/update","PUT",{daily:c.target.checked})}),"Check for updates every day"]}),t.jsx("span",{className:"note",children:"Turn it off on a network without internet."})]})]}),t.jsxs("div",{className:"about-acts",children:[t.jsx("button",{className:"btn sm",disabled:n,onClick:()=>void a(),children:n?"Checking…":"Check for updates"}),t.jsx("a",{className:"btn sm",href:e.notesUrl,target:"_blank",rel:"noreferrer",children:"Release notes"}),o&&t.jsxs("button",{className:"btn sm pri",disabled:n,onClick:()=>void s("/api/v1/app/update","POST"),children:[t.jsx(os,{size:14})," Update to ",e.latest]}),t.jsx("span",{className:"grow"}),t.jsx(se,{text:"squad upgrade"})]}),e.newer&&(e.devInstall||e.major)&&t.jsx(Af,{text:e.command})]})}function w8(){const{data:e}=hu(),[n,s]=$.useState(!1);return t.jsxs(t.Fragment,{children:[t.jsxs("button",{className:"btn sm",onClick:()=>s(!0),title:"Version and updates",children:[e?`squad-kit ${e.current}`:"About",e?.newer&&t.jsx("span",{className:"about-dot","aria-label":`${e.latest} is ready`})]}),n&&t.jsx(Ve,{title:"About squad-kit",onClose:()=>s(!1),children:t.jsx(Fk,{})})]})}function Vr(e){const n=e.changes?.at(-1);return n&&n.status!=="done"&&n.status!=="declined"?n:void 0}function Es(e){const n=Vr(e)?.status;return n==="proposed"||n==="failed"||n==="design-ready"}function zo(e){return!!(e.waiting||e.quiet?.kind==="stuck"||e.outdated?.length||Es(e)||ds(e))}function ds(e){return!!e.testChange?.ask}function Pf(e){return ds(e)?"squad-kit cannot tell which way of testing to keep":""}function N8(e,n){return n>0?`(${n}) ${e}`:e}function S8(e,n){const s=Math.max(0,(n-Date.parse(e))/1e3);if(!Number.isFinite(s)||s<60)return"just now";if(s<3600)return`waiting ${Math.round(s/60)} min`;if(s<86400)return`waiting ${Math.round(s/3600)} h`;const r=Math.round(s/86400);return`waiting ${r} ${r===1?"day":"days"}`}function Lk(e){return!e.waiting&&e.quiet?.kind==="stuck"?e.quiet.since:e.activity[0]?.at??e.createdAt}class C8{rank=new Map;next=0;sort(n){const s=n.filter(a=>!this.rank.has(a.key)).sort((a,o)=>a.since.localeCompare(o.since)||a.key.localeCompare(o.key));for(const a of s)this.rank.set(a.key,this.next++);const r=new Set(n.map(a=>a.key));for(const a of this.rank.keys())r.has(a)||this.rank.delete(a);return[...n].sort((a,o)=>this.rank.get(a.key)-this.rank.get(o.key))}}function $8(e){const n=new Set;return e.waiting&&n.add(e.waiting.kind),Es(e)&&n.add("change"),e.quiet?.kind==="stuck"&&n.add("quiet"),e.outdated?.length&&n.add("outdated"),ds(e)&&e.waiting?.kind!=="plan"&&n.add("test-command"),[...n]}const E8=["yours","chat","release"];function T8(e){return!E8.includes(e)}function A8(e,n,s){const r=Vr(n),a=s==="ask"?n.agentQuestion?.at:s==="change"&&r?`${r.id}-${r.status==="design-ready"?"design":"spec"}`:s==="quiet"?n.quiet?.since:s==="outdated"?n.outdated?.map(o=>o.adr).join("+"):s==="test-command"?n.testChange?.to:void 0;return`${e}/${n.id}/${s}${a?`/${a}`:""}`}function P8(e){return e.flatMap(({project:n,ticket:s})=>$8(s).filter(T8).map(r=>({key:A8(n.id,s,r),project:n,ticket:s,reason:r})))}const qc=2*6e4;class R8{known=null;gone=new Map;next(n,s){const r=new Set(n.map(c=>c.key));if(!this.known)return this.known=r,[];const a=this.known,o=n.filter(c=>!a.has(c.key)&&!(s-(this.gone.get(c.key)??-1/0)<qc));for(const c of a)r.has(c)||this.gone.set(c,s);for(const[c,u]of this.gone)(r.has(c)||s-u>=qc)&&this.gone.delete(c);return this.known=r,o}}const vx="sk.notices.shown";function _k(e,n,s){if(!s)return!0;let r={};try{r=JSON.parse(s.getItem(vx)??"{}")}catch{r={}}if(n-(r[e]??-1/0)<qc)return!1;const a=Object.fromEntries(Object.entries(r).filter(([,o])=>n-o<qc));a[e]=n;try{s.setItem(vx,JSON.stringify(a))}catch{}return!0}const I8={analyst:"Analyst",architect:"Architect",builder:"Builder",reviewer:"Reviewer",tester:"Tester"};function z8(e){const n=e.ticket,s={questions:"the squad has questions for you",ask:`the ${I8[n.agentQuestion?.from??""]??"squad"} has a question`,spec:"the spec is ready for you",plan:n.specApproved?"the design is ready for you":"the plan is ready for you",change:"a change waits for you",depends:"it needs a ticket that is not merged yet",proof:"the proof is ready to check",stuck:"the squad stopped and needs you",quiet:"a step looks stuck",outdated:"a newer decision changes the plan","test-command":"a choice about the tests waits for you",yours:"you took it over",chat:"your talk with the squad",release:"ready to release"};return{title:`${n.id}: ${s[e.reason]}`,body:`${n.title} · ${e.project.name}`}}function Ok(e,n){const s=`/p/${encodeURIComponent(e)}`;return n.waiting?.kind==="proof"?`${s}/tickets/${encodeURIComponent(n.id)}/proof`:`${s}/board?ticket=${encodeURIComponent(n.id)}`}const M8=8e3;function F8(e,n){return e?n.secure?e.permission==="granted"||e.permission==="denied"?Promise.resolve(e.permission):new Promise(s=>{let r=!1;const a=u=>{r||(r=!0,clearTimeout(c),s(u))},o=u=>a(u==="granted"||u==="denied"||u==="default"?u:e.permission==="default"?"default":e.permission),c=setTimeout(()=>a(e.permission==="default"?"timeout":e.permission),n.timeoutMs??M8);try{const u=e.requestPermission(o);u&&typeof u.then=="function"&&u.then(o,()=>a(e.permission==="default"?"error":e.permission))}catch{a(e.permission==="default"?"error":e.permission)}}):Promise.resolve("insecure"):Promise.resolve("unsupported")}const Ka="Allow notifications for this page in your browser's site settings (the icon next to the address), then reload. On a Mac, also check System Settings › Notifications for your browser.";function L8(e){switch(e){case"granted":return{choice:"on",test:!0,bad:!1,say:"Desktop notices are on. Didn't see one just now? Your computer may block notices for this browser: check the system's notification settings."};case"denied":return{choice:"on",test:!1,bad:!0,say:`Your browser blocks notices from this page. ${Ka}`};case"timeout":return{choice:"on",test:!1,bad:!0,say:`Your browser has not answered. ${Ka} Notices start once it allows them.`};case"error":return{choice:"on",test:!1,bad:!0,say:`Your browser did not let this page ask. ${Ka}`};case"insecure":return{choice:null,test:!1,bad:!0,say:"Your browser shows desktop notices only on a secure page. Open the board on this computer, at its 127.0.0.1 or localhost address, to turn them on."};case"unsupported":return{choice:null,test:!1,bad:!0,say:"This browser can't show desktop notices. The banner and the tab title still show what needs you."};default:return{choice:"off",test:!1,bad:!1,say:"No desktop notices for now. Turn them on in Settings any time."}}}const qk="Your browser is asking: look near the address bar.";function _8(e,n){const s=e.filter(d=>d.kind==="tests"),r=e.filter(d=>d.kind!=="tests"),a=new Set(r.map(d=>d.id)),o=n.filter(d=>a.has(d.from)&&a.has(d.to)&&d.from!==d.to),c=new Map(r.map(d=>[d.id,0]));for(let d=0;d<r.length;d+=1){let p=!1;for(const f of o){const m=c.get(f.from)+1;m>c.get(f.to)&&m<r.length&&(c.set(f.to,m),p=!0)}if(!p)break}const u=[];for(const d of r)(u[c.get(d.id)]??=[]).push(d);return{columns:u.filter(Boolean),below:s}}function O8(e,n,s){return s.filter(r=>r.from===e.id).map(r=>`${r.label??"uses"} ${n.find(a=>a.id===r.to)?.name??r.to}`).join(" · ")}function Mp(e,n){if(e.state==="now"&&e.since){const s=Math.max(0,Math.floor((n-Date.parse(e.since))/1e3));return`${Math.floor(s/60)}:${String(s%60).padStart(2,"0")}`}return e.state==="todo"||e.state==="skipped"||e.seconds===void 0?"":e.seconds<60?`${Math.max(1,e.seconds)} s`:`${Math.round(e.seconds/60)} min`}const Dk="sk.notices.setup";function uo(e){try{const n=JSON.parse(e?.getItem(Dk)??"[]");return Array.isArray(n)?n.filter(s=>typeof s=="string"):[]}catch{return[]}}function Bk(e,n){try{e?.setItem(Dk,JSON.stringify([...new Set(n)]))}catch{}}function q8(e,n){Bk(e,[...uo(e),n])}function D8(e,n){Bk(e,uo(e).filter(s=>s!==n))}function B8(e,n){return e.filter(s=>n.includes(s.id)&&s.setup?.ready&&!s.setup.approved)}function W8(e){return{title:`${e} is ready`,body:"squad-kit has read your project. Check what it understood, then start."}}function Le(e){return/["$`\\!]/.test(e)?`'${e.replace(/'/g,"'\\''")}'`:`"${e}"`}function Hi(e){return/^[\w@%+=:,./#-]+$/.test(e)&&!e.startsWith("#")?e:Le(e)}function Wk(e){let n;do n=e,e=e.replace(/<!--[\s\S]*?-->/g,"");while(e!==n);return e}const jx="Skip: let the Analyst decide",U8={reading:"Analyst reading",questions:"Questions for you",drafting:"Analyst writing the breakdown",ready:"Ready for you to approve",approved:"Approved",failed:"Stopped"},H8={reading:"ok",questions:"you",drafting:"ok",ready:"you",approved:"ok",failed:"bug"};function Uk(e){if(e.status!=="approved")return{text:U8[e.status],tone:H8[e.status]};if(e.counts.stories>0&&e.counts.merged===e.counts.stories)return{text:"Built",tone:"ok"};const n=e.state?.build;return n?.on?{text:"Building continuously",tone:"ok"}:n?{text:"Paused",tone:"plain"}:e.building?{text:"Building",tone:"ok"}:{text:"Approved",tone:"ok"}}function V8(e){return Uk({status:e.status,counts:e.counts,building:e.building})}function _t(e,n,s=`${n}s`){return`${e} ${e===1?n:s}`}function K8(e){return`${_t(e.epics,"epic")}, ${_t(e.features,"feature")}, ${_t(e.stories,"story","stories")}`}function Y8(e){if(e<90)return`${Math.max(1,Math.round(e))} min`;const n=Math.round(e/30)/2;return`${n} ${n===1?"hour":"hours"}`}function Q8(e){return e>0&&e<1?"under $1":`$${Math.round(e)}`}function Hk(e){return e.rough?"a rough guess: no finished tickets yet":`based on ${_t(e.basedOn,"finished ticket")}`}function Rf(e){return{...e.costUsd!==void 0?{cost:Q8(e.costUsd)}:{},time:Y8(e.minutes)}}function G8(e){if(!e.stories)return"Every story is merged.";const{cost:n,time:s}=Rf(e);return`${_t(e.stories,"story","stories")}, about ${n?`${n} and `:""}${s}, ${e.parallel} at a time, ${Hk(e)}`}function Z8(e){if(!e.stories)return"Every story is merged";const{cost:n,time:s}=Rf(e);return`About ${s}${n?` and ${n}`:""} left`}function Kr(e){return!!(e&&(e.status==="pending"||e.status==="running"||e.status==="stopping"))}const Vk=e=>e.charAt(0).toUpperCase()+e.slice(1);function X8(e){return e?`${Vk(e.unit)} ${Math.max(1,Math.min(e.done,e.of||e.done))} of ${e.of}`:""}function zh(e){if(!e||!e.epics&&!e.features&&!e.stories)return"";const n=[_t(e.epics,"epic"),_t(e.features,"feature"),...e.stories?[_t(e.stories,"story","stories")]:[]];return`Found ${n.length===3?`${n[0]}, ${n[1]} and ${n[2]}`:n.join(" and ")} so far.`}function bx(e){return e<60?"less than a minute":`${Math.round(e/60)} min`}function J8(e,n=Date.now()){if(!e)return"";const s=e.startedAt?Math.max(0,(n-Date.parse(e.startedAt))/1e3):null,r=e.usualSeconds?`usually about ${bx(e.usualSeconds)}${e.at?.of?` for ${_t(e.at.of,e.at.unit)}`:""}`:"";return[s!==null?`${bx(s)} so far`:"",r].filter(Boolean).join(", ")}function e7(e){const n=e.source,s=n.pictures?`, tables and ${_t(n.pictures,"picture")}, so the Analyst sees the mockups too`:" and tables";return n.kind==="docx"?{title:"Turned the Word file into text",sub:`Kept the headings${s}.`}:n.kind==="pdf"?{title:"Kept the PDF as it is",sub:`The Analyst reads ${n.pages?`its ${_t(n.pages,"page")}`:"it"} directly, pictures and all.`}:n.kind==="pasted"?{title:"Saved the pasted text",sub:n.pages&&n.pages>1?`In ${n.pages} parts, so the Analyst reads it part by part.`:"The Analyst reads it as you pasted it."}:{title:"Saved the text",sub:n.pages&&n.pages>1?`In ${n.pages} parts, so the Analyst reads it part by part.`:"The Analyst reads it as it is."}}function t7(e){const n=e.state.job,s=n?.step,r=e.status==="failed",a=["text","read","questions","draft"],o=e.status==="questions"?"questions":e.status==="drafting"||s==="draft"?"draft":s==="text"?"text":e.status==="ready"||e.status==="approved"?"draft":"read",c=a.indexOf(o),u=e.status==="ready"||e.status==="approved",d=y=>{const x=a.indexOf(y);return u||x<c?"done":x>c?"todo":r?"failed":"now"},p=o==="read"&&n?[X8(n.at),zh(n.found)].filter(Boolean):[],f=n?.status==="pending"&&n.now?n.now:"",m=e.questions.length;return[{key:"text",...e7(e),state:d("text")},{key:"read",title:"Reading the document",sub:d("read")==="now"?f&&!n?.at?.done?`${f}.`:p.length?`${p[0]}${p[1]?`. ${p[1]}`:"."}`:"Starting to read.":d("read")==="failed"?"It stopped here. Nothing it found is lost.":d("read")==="done"?"Read the whole document.":"Page by page, writing down the epics and features it finds.",state:d("read"),...o==="read"&&n?.at?.of?{bar:{done:n.at.done,of:n.at.of}}:{}},{key:"questions",title:"Questions for you",sub:d("questions")==="done"&&c>2?m?`${_t(m,"question")}, answered.`:"None: the BRD was clear.":"Only when something is missing or two parts clash. Small things it decides and writes down.",state:d("questions")},{key:"draft",title:"Writing the epics, features and stories",sub:d("draft")==="now"&&n?.now?`${n.now}.${zh(n.found)?` ${zh(n.found)}`:""}`:'Each story gets "done when" checks, its size, what it needs first, and where it comes from in the BRD.',state:d("draft")}]}function Mo(e){return e?[[e.section,e.title].filter(Boolean).join(" "),e.page?`page ${e.page}`:""].filter(Boolean).join(", "):""}function n7(e){return/^\d/.test(e.trim())?`From section ${e.trim()}`:`From ${e.trim()}`}function s7(e){return[e.section??e.title,e.page?`page ${e.page}`:""].filter(Boolean).join(", ")}function Fo(e){return e.epics.flatMap(n=>[...n.features.flatMap(s=>s.stories.map(r=>({story:r,epic:n,feature:s}))),...n.stories.map(s=>({story:s,epic:n}))])}function Vn(e,n){if(!n)return null;for(const s of e.epics){if(s.key===n)return{level:"epic",item:s,epic:s};for(const a of s.features){if(a.key===n)return{level:"feature",item:a,epic:s,feature:a};const o=a.stories.find(c=>c.key===n);if(o)return{level:"story",item:o,epic:s,feature:a,story:o}}const r=s.stories.find(a=>a.key===n);if(r)return{level:"story",item:r,epic:s,story:r}}return null}function Yr(e){return"features"in e?[...e.features.flatMap(n=>n.stories),...e.stories]:e.stories}function r7(e){return e.level==="epic"?"":[e.epic.title,e.level==="story"?e.feature?.title:void 0].filter(Boolean).join(" › ")}function Kk(e){const n=_t(Yr(e).length,"story","stories");return"features"in e&&e.features.length?`${_t(e.features.length,"feature")}, ${n}`:n}function i7(e,n){return n.level==="epic"?[]:n.level==="feature"?e.epics.map(s=>({key:s.key,label:`${s.key} ${s.title}`})):e.epics.flatMap(s=>[...s.features.map(r=>({key:r.key,label:`${s.title} › ${r.title}`})),{key:s.key,label:`${s.title}, straight under the epic`}])}function a7(e){if(e.level!=="epic")return e.level==="feature"?e.epic.key:e.feature?.key??e.epic.key}const o7=["merged","released"];function pu(e){return!!(e&&o7.includes(e))}function Dc(e,n){return{done:e.filter(s=>pu(n.get(s.key)?.state)).length,of:e.length}}function l7(e){const n=Math.max(0,e.stories-e.merged-e.building-e.needsYou);return{merged:e.merged,building:e.building,needsYou:e.needsYou,rest:n}}function wx(e,n){const s=new Map(e.progress.map(r=>[r.key,r]));return Fo(e).filter(({story:r})=>r.dependsOn.includes(n)&&!pu(s.get(r.key)?.state)).map(({story:r})=>r.key)}function c7(e,n){const s=new Map(e.progress.map(r=>[r.key,r]));return n.dependsOn.filter(r=>!pu(s.get(r)?.state))}function Yk(e){return e==="clash"?"Two parts clash":e==="gap"?"Missing in the BRD":e==="check"?"A check failed":"Needs you"}function Qk(e){const n=/^(.+?[.?!])(\s|$)/.exec(e.trim());return(n?n[1]:e).trim()}function Nx(e,n){const s=new Set,r=new Map(e.progress.map(u=>[u.key,u.state])),a=["building","needs-you","next","waits"],o=e.progress.some(u=>a.includes(u.state)),c=Vn(e,n);return e.epics.forEach((u,d)=>{const p=c?.epic.key===u.key,f=Yr(u).some(m=>a.includes(r.get(m.key)));(p||(o?f:d===0))&&s.add(u.key);for(const m of u.features){const y=m.stories.some(x=>a.includes(r.get(x.key)));(c?.feature?.key===m.key||c?.item.key===m.key||(o?y:d===0))&&s.add(m.key)}}),s}const u7={analyst:"Analyst",architect:"Architect",builder:"Builder",tester:"Tester",reviewer:"Reviewer",answer:"from your answer"};function Sx(e){return[e.item,e.ticket,u7[e.by]??e.by].filter(Boolean).join(" · ")}function Mh(e){const n=e.trim().split(/\s+/),s=n.pop()??"",r=/[^aeiou]y$/i.test(s)?`${s.slice(0,-1)}ies`:/s$/i.test(s)?s:`${s}s`;return[...n,r].map((o,c)=>c===0?Vk(o.toLowerCase()):o.toLowerCase()).join(" ")}function Fh(e,n){if(n||e.new===e.all&&e.all>0)return"new";const s=[e.new?`${e.new} new`:"",e.changed?`${e.changed} changed`:""].filter(Boolean);return s.length?s.join(", "):"no changes"}function d7(e){const n=Fo(e).find(({story:s})=>s.dependsOn.length);return n?`${n.story.key} needs ${n.story.dependsOn[0]}`:null}function Fp(e,n){if(!e)return{phase:"unknown",of:0,pct:0};const s=(p,f)=>f>0?Math.min(100,Math.round(p/f*100)):5,r=n&&(!n.at||!e.at||n.at===e.at)?n:null,a=e.links,o=e.items?.of??r?.items??(a?e.of:void 0);if(o===void 0)return{phase:"unknown",of:e.of,pct:s(e.done,e.of)};const c=e.items?.done??Math.min(e.done,o),u=a?.of??r?.links??0,d=e.items||a?s(c+(a?.done??0),o+(a?.of??0)):s(e.done,e.of);return c>=o&&u>0?{phase:"links",...a?{done:a.done}:{},of:u,pct:d}:{phase:"items",done:c,of:o,pct:d}}function Gk(e){return e.phase==="links"?e.done===void 0?`adding the ${_t(e.of,"link")}`:`adding the links, ${e.done} of ${e.of}`:e.phase==="items"?`${e.done} of ${_t(e.of,"item")}`:""}function h7(e){const n=e.counts.stories;if(!n||e.counts.merged<n)return null;const s=n===1?"The story is merged":`All ${n} stories are merged`;return e.progress.length>0&&e.progress.every(a=>a.state==="released")?{text:`${s} and went out in a release.`,release:!1}:{text:`${s} and ${n===1?"waits":"wait"} in the next release.`,release:!0}}function Zk(e,n){return n?/^c\d+$/.test(n)?`It became a small change on ${e}. The Analyst writes it into the spec.`:`${e} is merged, so it became a new ticket, ${n}, linked to it.`:`Changed on ${e}.`}function p7(e,n){const s=e.trim(),r=n.trim().replace(/[.!]$/,"").toLowerCase();return!r||!s.toLowerCase().startsWith(r)?s:s.slice(r.length).replace(/^[.!]?\s*/,"")||s}const Lp=e=>!e.trim();function Lh(e){const n=[e.given,e.when,e.then];return n.some(Lp)&&!n.every(Lp)}function Cx(e){return e.filter(n=>![n.given,n.when,n.then].every(Lp))}function $x(e){return`Add the part that was left out: ${e.text}${e.ref?` (${Mo(e.ref)})`:""}.`}function f7(e,n){const s=r=>!n||r.owner.trim().toLowerCase()===n.trim().toLowerCase();return e.filter(s).reduce((r,a)=>r+(a.status==="questions"?1:0)+a.counts.needsYou,0)}const bs={col:172,gap:14,epicGap:44,pad:24,epicH:74,featY:160,featH:72,storyY:258,storyH:44,storyStep:50,popW:300,popH:150,rowWidth:1600};function m7(e,n=bs.rowWidth){const{col:s,gap:r,epicGap:a,pad:o,epicH:c,featY:u,featH:d,storyY:p,storyH:f,storyStep:m}=bs,y=new Map(e.progress.map(T=>[T.key,T])),x=[],k=[],v=c+(u-c)/2;let b=o,N=0,C=o,S=o+u+d,P=o*2+s;const M=(T,F,R)=>{T.forEach((B,I)=>{x.push({key:B.key,level:"story",row:N,x:F,y:R+I*m,w:s,h:f,title:B.title,state:y.get(B.key)?.state??"not-started"})}),T.length&&(S=Math.max(S,R+(T.length-1)*m+f))};for(const T of e.epics){const F=[...T.features.map(_=>({kind:"feature",f:_})),...T.stories.length?[{kind:"stories"}]:[]],R=Math.max(1,F.length),B=R*s+(R-1)*r;b>o&&b+B+o>n&&(N+=1,b=o,C=S+a,S=C+u+d);const I=b+B/2;x.push({key:T.key,level:"epic",row:N,x:b,y:C,w:B,h:c,title:T.title,done:Dc(Yr(T),y)});const O=F.map((_,Q)=>b+Q*(s+r)+s/2);O.length&&(k.push({x1:I,y1:C+c,x2:I,y2:C+v}),k.push({x1:Math.min(I,O[0]),y1:C+v,x2:Math.max(I,O.at(-1)),y2:C+v})),F.forEach((_,Q)=>{const q=b+Q*(s+r),K=O[Q];_.kind==="feature"?(k.push({x1:K,y1:C+v,x2:K,y2:C+u}),x.push({key:_.f.key,level:"feature",row:N,x:q,y:C+u,w:s,h:d,title:_.f.title,done:Dc(_.f.stories,y)}),_.f.stories.length&&k.push({x1:K,y1:C+u+d,x2:K,y2:C+p}),M(_.f.stories,q,C+p)):(k.push({x1:K,y1:C+v,x2:K,y2:C+p}),M(T.stories,q,C+p))}),P=Math.max(P,b+B+o),b+=B+a}return{boxes:x,lines:k,width:P,height:S+o}}function If(e){return pu(e)?"m":e==="building"?"b":e==="needs-you"?"y":"w"}function g7(e,n){const s=Math.max(bs.pad/2,Math.min(n.x,e.width-bs.popW-bs.pad/2)),r=s+bs.popW,a=e.boxes.filter(c=>c.level!=="epic"&&c.row===n.row&&c.x<r&&c.x+c.w>s).map(c=>c.y+c.h),o=Math.max(n.y+n.h,...a)+14;return{left:s,top:o,height:Math.max(e.height,o+bs.popH+bs.pad)}}function x7(e,n){if(!n.width||!n.height)return 1;const s=Math.min(n.width/e.width,n.height/e.height,1);return Math.max(.3,Math.round(s*100)/100)}function y7(e,n){return n.width?Math.max(.6,Math.min(1,Math.round(n.width/e.width*100)/100)):1}const Xk="sk.chatdock",_p=new Set;function k7(){try{const e=JSON.parse(localStorage.getItem(Xk)??"{}");return{tab:e.tab??null,min:!!e.min,width:Jk(e.width??600),seen:e.seen??{}}}catch{return{tab:null,min:!1,width:600,seen:{}}}}let Mr=typeof window>"u"?{tab:null,min:!1,width:600,seen:{}}:k7();function Jk(e){return Math.max(440,Math.min(900,Math.round(e)))}function wi(e){Mr={...Mr,...e};try{localStorage.setItem(Xk,JSON.stringify(Mr))}catch{}for(const n of _p)n()}const rs={get:()=>Mr,show:e=>wi({tab:e,min:!1}),pick:e=>wi({tab:e}),minimize:()=>wi({min:!0}),restore:()=>wi({min:!1}),resize:e=>wi({width:Jk(e)}),seen:(e,n)=>{Mr.seen[e]!==n&&wi({seen:{...Mr.seen,[e]:n}})}};function Vi(e){return $.useSyncExternalStore(n=>{const s=window.matchMedia?.(e);return s?.addEventListener("change",n),()=>s?.removeEventListener("change",n)},()=>!!window.matchMedia?.(e).matches)}const Ki="(max-width: 760px)";function fu(){return $.useSyncExternalStore(e=>(_p.add(e),()=>_p.delete(e)),()=>Mr)}const Op="؀-ۿݐ-ݿࢠ-ࣿﭐ-﷿ﹰ-\uFEFF",v7=new RegExp(`[${Op}]`,"g"),j7=/[A-Za-z]/g;function In(e){const n=String(e??"").replace(/```[\s\S]*?(```|$)/g," ").replace(/`[^`]*`/g," ").replace(/(https?:\/\/|file:\/\/)\S+/g," "),s=n.match(v7)?.length??0,r=n.match(j7)?.length??0,a=s+r;if(!a)return{lang:"none",dir:"ltr",share:0};const o=s/a;return{lang:o>=.85?"ar":o<=.15?"en":"mixed",dir:o>=.5?"rtl":"ltr",share:o}}function Is(e){return e.dir==="rtl"?"t-ar":e.lang==="mixed"?"t-mx":"t-en"}function b7(e){const n=e.dir==="rtl"?"right to left":"left to right";return e.lang==="ar"?`Arabic · ${n}`:e.lang==="en"?`English · ${n}`:e.lang==="mixed"?`Mixed · ${n}`:""}const ev="[0-9\\u0660-\\u0669][0-9\\u0660-\\u0669.,:%/+\\-]*",w7=`(?:${ev}[  ]+)*[A-Za-z][A-Za-z0-9._\\-/+#@:]*(?:[  ]+[A-Za-z0-9][A-Za-z0-9._\\-/+#@:]*)*`,N7=`[${Op}]+(?:[  ]+(?:${ev}[  ]+)*[${Op}]+)*`,S7=new RegExp(`(${w7})|(${N7})`,"g");function C7(e,n){const s=[];let r=0;const a=(o,c)=>{if(!o)return;const u=s.at(-1);u&&!u.dir&&!c?u.text+=o:s.push(c?{text:o,dir:c}:{text:o})};for(const o of e.matchAll(S7)){const c=o.index??0;a(e.slice(r,c));const u=!!o[1];a(o[0],u&&n==="rtl"?"ltr":!u&&n==="ltr"?"rtl":void 0),r=c+o[0].length}return a(e.slice(r)),s}function $7(e){const n=e.filter(s=>s==="rtl").length;return e.length&&n*2>=e.length?"rtl":"ltr"}function E7(e,n){if(n<=0)return"";let s=0;for(const r of e.matchAll(/\S+/g))if(s+=1,s===n)return e.slice(0,(r.index??0)+r[0].length);return e}function T7(e){return e.match(/\S+/g)?.length??0}const tv=new Set(["p","li","h1","h2","h3","h4","h5","h6","td","th","dt","dd","figcaption"]),zf=new Set(["code","pre","svg","math"]);function nv(e,n=!1){return e.type==="text"?e.value??"":e.tagName&&zf.has(e.tagName)||n&&e.tagName&&(e.tagName==="ul"||e.tagName==="ol")?" ":(e.children??[]).map(s=>nv(s,!0)).join("")}function A7(e,n){const s=e.properties??={},r=Array.isArray(s.className)?s.className:typeof s.className=="string"?[s.className]:[];s.className=[...r,n]}function Mf(e,n,s){return{type:"element",tagName:e,properties:n,children:s}}function sv(e,n,s){if(!e.children||e.tagName&&zf.has(e.tagName))return;const r=[];for(const a of e.children){if(a.type!=="text"){a.type==="element"&&!(a.tagName&&tv.has(a.tagName))&&sv(a,n,s),r.push(a);continue}for(const o of C7(a.value??"",n)){const c=s?P7(o.text):[{type:"text",value:o.text}];o.dir?r.push(Mf("bdi",{dir:o.dir},c)):r.push(...c)}}e.children=r}function P7(e){return e.split(/(\s+)/).filter(Boolean).map(n=>/^\s+$/.test(n)?{type:"text",value:n}:Mf("span",{className:["fx"]},[{type:"text",value:n}]))}function R7(e,n={}){let s=null;const r=a=>{if(a.type==="element"&&a.tagName&&zf.has(a.tagName)){a.tagName==="code"&&((a.properties??={}).dir="ltr"),a.tagName==="pre"&&(s=a);return}if(a.type==="element"&&a.tagName&&tv.has(a.tagName)){const o=In(nv(a));if(o.lang!=="none"){const c=a.properties??={};c.dir=o.dir,c.lang=o.dir==="rtl"?"ar":"en",A7(a,Is(o))}sv(a,o.dir,!!n.stream),s=a}for(const o of a.children??[])r(o);if(a.type==="element"&&(a.tagName==="ul"||a.tagName==="ol"||a.tagName==="table")){const o=[],c=u=>{for(const d of u.children??[]){if(d.type!=="element")continue;const p=d.tagName==="li"||d.tagName==="td"||d.tagName==="th";p&&d.properties?.dir&&o.push(d.properties.dir),(!p||a.tagName==="table")&&c(d)}};c(a),o.length&&((a.properties??={}).dir=$7(o))}};return r(e),n.caret&&s&&s.tagName!=="pre"&&(s.children??=[]).push(Mf("span",{className:["caret"],ariaHidden:"true"},[])),e}function I7(e={}){return n=>{R7(n,e)}}function z7(e,n){const s={};return(e[e.length-1]===""?[...e,""]:e).join((s.padRight?" ":"")+","+(s.padLeft===!1?"":" ")).trim()}const M7=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,F7=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,L7={};function Ex(e,n){return(L7.jsx?F7:M7).test(e)}const _7=/[ \t\n\f\r]/g;function O7(e){return typeof e=="object"?e.type==="text"?Tx(e.value):!1:Tx(e)}function Tx(e){return e.replace(_7,"")===""}class Lo{constructor(n,s,r){this.normal=s,this.property=n,r&&(this.space=r)}}Lo.prototype.normal={};Lo.prototype.property={};Lo.prototype.space=void 0;function rv(e,n){const s={},r={};for(const a of e)Object.assign(s,a.property),Object.assign(r,a.normal);return new Lo(s,r,n)}function qp(e){return e.toLowerCase()}class an{constructor(n,s){this.attribute=s,this.property=n}}an.prototype.attribute="";an.prototype.booleanish=!1;an.prototype.boolean=!1;an.prototype.commaOrSpaceSeparated=!1;an.prototype.commaSeparated=!1;an.prototype.defined=!1;an.prototype.mustUseProperty=!1;an.prototype.number=!1;an.prototype.overloadedBoolean=!1;an.prototype.property="";an.prototype.spaceSeparated=!1;an.prototype.space=void 0;let q7=0;const ze=Qr(),pt=Qr(),Dp=Qr(),ue=Qr(),Ze=Qr(),Pi=Qr(),gn=Qr();function Qr(){return 2**++q7}const Bp=Object.freeze(Object.defineProperty({__proto__:null,boolean:ze,booleanish:pt,commaOrSpaceSeparated:gn,commaSeparated:Pi,number:ue,overloadedBoolean:Dp,spaceSeparated:Ze},Symbol.toStringTag,{value:"Module"})),_h=Object.keys(Bp);class Ff extends an{constructor(n,s,r,a){let o=-1;if(super(n,s),Ax(this,"space",a),typeof r=="number")for(;++o<_h.length;){const c=_h[o];Ax(this,_h[o],(r&Bp[c])===Bp[c])}}}Ff.prototype.defined=!0;function Ax(e,n,s){s&&(e[n]=s)}function Yi(e){const n={},s={};for(const[r,a]of Object.entries(e.properties)){const o=new Ff(r,e.transform(e.attributes||{},r),a,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),n[r]=o,s[qp(r)]=r,s[qp(o.attribute)]=r}return new Lo(n,s,e.space)}const iv=Yi({properties:{ariaActiveDescendant:null,ariaAtomic:pt,ariaAutoComplete:null,ariaBusy:pt,ariaChecked:pt,ariaColCount:ue,ariaColIndex:ue,ariaColSpan:ue,ariaControls:Ze,ariaCurrent:null,ariaDescribedBy:Ze,ariaDetails:null,ariaDisabled:pt,ariaDropEffect:Ze,ariaErrorMessage:null,ariaExpanded:pt,ariaFlowTo:Ze,ariaGrabbed:pt,ariaHasPopup:null,ariaHidden:pt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Ze,ariaLevel:ue,ariaLive:null,ariaModal:pt,ariaMultiLine:pt,ariaMultiSelectable:pt,ariaOrientation:null,ariaOwns:Ze,ariaPlaceholder:null,ariaPosInSet:ue,ariaPressed:pt,ariaReadOnly:pt,ariaRelevant:null,ariaRequired:pt,ariaRoleDescription:Ze,ariaRowCount:ue,ariaRowIndex:ue,ariaRowSpan:ue,ariaSelected:pt,ariaSetSize:ue,ariaSort:null,ariaValueMax:ue,ariaValueMin:ue,ariaValueNow:ue,ariaValueText:null,role:null},transform(e,n){return n==="role"?n:"aria-"+n.slice(4).toLowerCase()}});function av(e,n){return n in e?e[n]:n}function ov(e,n){return av(e,n.toLowerCase())}const D7=Yi({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Pi,acceptCharset:Ze,accessKey:Ze,action:null,allow:null,allowFullScreen:ze,allowPaymentRequest:ze,allowUserMedia:ze,alt:null,as:null,async:ze,autoCapitalize:null,autoComplete:Ze,autoFocus:ze,autoPlay:ze,blocking:Ze,capture:null,charSet:null,checked:ze,cite:null,className:Ze,cols:ue,colSpan:null,content:null,contentEditable:pt,controls:ze,controlsList:Ze,coords:ue|Pi,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ze,defer:ze,dir:null,dirName:null,disabled:ze,download:Dp,draggable:pt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ze,formTarget:null,headers:Ze,height:ue,hidden:Dp,high:ue,href:null,hrefLang:null,htmlFor:Ze,httpEquiv:Ze,id:null,imageSizes:null,imageSrcSet:null,inert:ze,inputMode:null,integrity:null,is:null,isMap:ze,itemId:null,itemProp:Ze,itemRef:Ze,itemScope:ze,itemType:Ze,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ze,low:ue,manifest:null,max:null,maxLength:ue,media:null,method:null,min:null,minLength:ue,multiple:ze,muted:ze,name:null,nonce:null,noModule:ze,noValidate:ze,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:ze,optimum:ue,pattern:null,ping:Ze,placeholder:null,playsInline:ze,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ze,referrerPolicy:null,rel:Ze,required:ze,reversed:ze,rows:ue,rowSpan:ue,sandbox:Ze,scope:null,scoped:ze,seamless:ze,selected:ze,shadowRootClonable:ze,shadowRootDelegatesFocus:ze,shadowRootMode:null,shape:null,size:ue,sizes:null,slot:null,span:ue,spellCheck:pt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ue,step:null,style:null,tabIndex:ue,target:null,title:null,translate:null,type:null,typeMustMatch:ze,useMap:null,value:pt,width:ue,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Ze,axis:null,background:null,bgColor:null,border:ue,borderColor:null,bottomMargin:ue,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ze,declare:ze,event:null,face:null,frame:null,frameBorder:null,hSpace:ue,leftMargin:ue,link:null,longDesc:null,lowSrc:null,marginHeight:ue,marginWidth:ue,noResize:ze,noHref:ze,noShade:ze,noWrap:ze,object:null,profile:null,prompt:null,rev:null,rightMargin:ue,rules:null,scheme:null,scrolling:pt,standby:null,summary:null,text:null,topMargin:ue,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ue,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:ze,disableRemotePlayback:ze,prefix:null,property:null,results:ue,security:null,unselectable:null},space:"html",transform:ov}),B7=Yi({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:gn,accentHeight:ue,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ue,amplitude:ue,arabicForm:null,ascent:ue,attributeName:null,attributeType:null,azimuth:ue,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ue,by:null,calcMode:null,capHeight:ue,className:Ze,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:ue,diffuseConstant:ue,direction:null,display:null,dur:null,divisor:ue,dominantBaseline:null,download:ze,dx:null,dy:null,edgeMode:null,editable:null,elevation:ue,enableBackground:null,end:null,event:null,exponent:ue,externalResourcesRequired:null,fill:null,fillOpacity:ue,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Pi,g2:Pi,glyphName:Pi,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ue,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ue,horizOriginX:ue,horizOriginY:ue,id:null,ideographic:ue,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ue,k:ue,k1:ue,k2:ue,k3:ue,k4:ue,kernelMatrix:gn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ue,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:ue,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:ue,overlineThickness:ue,paintOrder:null,panose1:null,path:null,pathLength:ue,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Ze,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ue,pointsAtY:ue,pointsAtZ:ue,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:gn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:gn,rev:gn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:gn,requiredFeatures:gn,requiredFonts:gn,requiredFormats:gn,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:ue,specularExponent:ue,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ue,strikethroughThickness:ue,string:null,stroke:null,strokeDashArray:gn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ue,strokeOpacity:ue,strokeWidth:null,style:null,surfaceScale:ue,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:gn,tabIndex:ue,tableValues:null,target:null,targetX:ue,targetY:ue,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:gn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ue,underlineThickness:ue,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ue,values:null,vAlphabetic:ue,vMathematical:ue,vectorEffect:null,vHanging:ue,vIdeographic:ue,version:null,vertAdvY:ue,vertOriginX:ue,vertOriginY:ue,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ue,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:av}),lv=Yi({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,n){return"xlink:"+n.slice(5).toLowerCase()}}),cv=Yi({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:ov}),uv=Yi({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,n){return"xml:"+n.slice(3).toLowerCase()}}),W7={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},U7=/[A-Z]/g,Px=/-[a-z]/g,H7=/^data[-\w.:]+$/i;function V7(e,n){const s=qp(n);let r=n,a=an;if(s in e.normal)return e.property[e.normal[s]];if(s.length>4&&s.slice(0,4)==="data"&&H7.test(n)){if(n.charAt(4)==="-"){const o=n.slice(5).replace(Px,Y7);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=n.slice(4);if(!Px.test(o)){let c=o.replace(U7,K7);c.charAt(0)!=="-"&&(c="-"+c),n="data"+c}}a=Ff}return new a(r,n)}function K7(e){return"-"+e.toLowerCase()}function Y7(e){return e.charAt(1).toUpperCase()}const Q7=rv([iv,D7,lv,cv,uv],"html"),Lf=rv([iv,B7,lv,cv,uv],"svg");function G7(e){return e.join(" ").trim()}var Ni={},Oh,Rx;function Z7(){if(Rx)return Oh;Rx=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,s=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,a=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,u=/^\s+|\s+$/g,d=`
563
- `,p="/",f="*",m="",y="comment",x="declaration";function k(b,N){if(typeof b!="string")throw new TypeError("First argument must be a string");if(!b)return[];N=N||{};var C=1,S=1;function P(q){var K=q.match(n);K&&(C+=K.length);var ce=q.lastIndexOf(d);S=~ce?q.length-ce:S+q.length}function M(){var q={line:C,column:S};return function(K){return K.position=new T(q),B(),K}}function T(q){this.start=q,this.end={line:C,column:S},this.source=N.source}T.prototype.content=b;function F(q){var K=new Error(N.source+":"+C+":"+S+": "+q);if(K.reason=q,K.filename=N.source,K.line=C,K.column=S,K.source=b,!N.silent)throw K}function R(q){var K=q.exec(b);if(K){var ce=K[0];return P(ce),b=b.slice(ce.length),K}}function B(){R(s)}function I(q){var K;for(q=q||[];K=O();)K!==!1&&q.push(K);return q}function O(){var q=M();if(!(p!=b.charAt(0)||f!=b.charAt(1))){for(var K=2;m!=b.charAt(K)&&(f!=b.charAt(K)||p!=b.charAt(K+1));)++K;if(K+=2,m===b.charAt(K-1))return F("End of comment missing");var ce=b.slice(2,K-2);return S+=2,P(ce),b=b.slice(K),S+=2,q({type:y,comment:ce})}}function _(){var q=M(),K=R(r);if(K){if(O(),!R(a))return F("property missing ':'");var ce=R(o),H=q({type:x,property:v(K[0].replace(e,m)),value:ce?v(ce[0].replace(e,m)):m});return R(c),H}}function Q(){var q=[];I(q);for(var K;K=_();)K!==!1&&(q.push(K),I(q));return q}return B(),Q()}function v(b){return b?b.replace(u,m):m}return Oh=k,Oh}var Ix;function X7(){if(Ix)return Ni;Ix=1;var e=Ni&&Ni.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ni,"__esModule",{value:!0}),Ni.default=s;const n=e(Z7());function s(r,a){let o=null;if(!r||typeof r!="string")return o;const c=(0,n.default)(r),u=typeof a=="function";return c.forEach(d=>{if(d.type!=="declaration")return;const{property:p,value:f}=d;u?a(p,f,d):f&&(o=o||{},o[p]=f)}),o}return Ni}var qa={},zx;function J7(){if(zx)return qa;zx=1,Object.defineProperty(qa,"__esModule",{value:!0}),qa.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,s=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(p){return!p||s.test(p)||e.test(p)},c=function(p,f){return f.toUpperCase()},u=function(p,f){return"".concat(f,"-")},d=function(p,f){return f===void 0&&(f={}),o(p)?p:(p=p.toLowerCase(),f.reactCompat?p=p.replace(a,u):p=p.replace(r,u),p.replace(n,c))};return qa.camelCase=d,qa}var Da,Mx;function eN(){if(Mx)return Da;Mx=1;var e=Da&&Da.__importDefault||function(a){return a&&a.__esModule?a:{default:a}},n=e(X7()),s=J7();function r(a,o){var c={};return!a||typeof a!="string"||(0,n.default)(a,function(u,d){u&&d&&(c[(0,s.camelCase)(u,o)]=d)}),c}return r.default=r,Da=r,Da}var tN=eN();const nN=hf(tN),dv=hv("end"),_f=hv("start");function hv(e){return n;function n(s){const r=s&&s.position&&s.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function sN(e){const n=_f(e),s=dv(e);if(n&&s)return{start:n,end:s}}function Ya(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Fx(e.position):"start"in e||"end"in e?Fx(e):"line"in e||"column"in e?Wp(e):""}function Wp(e){return Lx(e&&e.line)+":"+Lx(e&&e.column)}function Fx(e){return Wp(e&&e.start)+"-"+Wp(e&&e.end)}function Lx(e){return e&&typeof e=="number"?e:1}class qt extends Error{constructor(n,s,r){super(),typeof s=="string"&&(r=s,s=void 0);let a="",o={},c=!1;if(s&&("line"in s&&"column"in s?o={place:s}:"start"in s&&"end"in s?o={place:s}:"type"in s?o={ancestors:[s],place:s.position}:o={...s}),typeof n=="string"?a=n:!o.cause&&n&&(c=!0,a=n.message,o.cause=n),!o.ruleId&&!o.source&&typeof r=="string"){const d=r.indexOf(":");d===-1?o.ruleId=r:(o.source=r.slice(0,d),o.ruleId=r.slice(d+1))}if(!o.place&&o.ancestors&&o.ancestors){const d=o.ancestors[o.ancestors.length-1];d&&(o.place=d.position)}const u=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=u?u.column:void 0,this.fatal=void 0,this.file="",this.message=a,this.line=u?u.line:void 0,this.name=Ya(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=c&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}qt.prototype.file="";qt.prototype.name="";qt.prototype.reason="";qt.prototype.message="";qt.prototype.stack="";qt.prototype.column=void 0;qt.prototype.line=void 0;qt.prototype.ancestors=void 0;qt.prototype.cause=void 0;qt.prototype.fatal=void 0;qt.prototype.place=void 0;qt.prototype.ruleId=void 0;qt.prototype.source=void 0;const Of={}.hasOwnProperty,rN=new Map,iN=/[A-Z]/g,aN=new Set(["table","tbody","thead","tfoot","tr"]),oN=new Set(["td","th"]),pv="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function lN(e,n){if(!n||n.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const s=n.filePath||void 0;let r;if(n.development){if(typeof n.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=gN(s,n.jsxDEV)}else{if(typeof n.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof n.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=mN(s,n.jsx,n.jsxs)}const a={Fragment:n.Fragment,ancestors:[],components:n.components||{},create:r,elementAttributeNameCase:n.elementAttributeNameCase||"react",evaluater:n.createEvaluater?n.createEvaluater():void 0,filePath:s,ignoreInvalidStyle:n.ignoreInvalidStyle||!1,passKeys:n.passKeys!==!1,passNode:n.passNode||!1,schema:n.space==="svg"?Lf:Q7,stylePropertyNameCase:n.stylePropertyNameCase||"dom",tableCellAlignToStyle:n.tableCellAlignToStyle!==!1},o=fv(a,e,void 0);return o&&typeof o!="string"?o:a.create(e,a.Fragment,{children:o||void 0},void 0)}function fv(e,n,s){if(n.type==="element")return cN(e,n,s);if(n.type==="mdxFlowExpression"||n.type==="mdxTextExpression")return uN(e,n);if(n.type==="mdxJsxFlowElement"||n.type==="mdxJsxTextElement")return hN(e,n,s);if(n.type==="mdxjsEsm")return dN(e,n);if(n.type==="root")return pN(e,n,s);if(n.type==="text")return fN(e,n)}function cN(e,n,s){const r=e.schema;let a=r;n.tagName.toLowerCase()==="svg"&&r.space==="html"&&(a=Lf,e.schema=a),e.ancestors.push(n);const o=gv(e,n.tagName,!1),c=xN(e,n);let u=Df(e,n);return aN.has(n.tagName)&&(u=u.filter(function(d){return typeof d=="string"?!O7(d):!0})),mv(e,c,o,n),qf(c,u),e.ancestors.pop(),e.schema=r,e.create(n,o,c,s)}function uN(e,n){if(n.data&&n.data.estree&&e.evaluater){const r=n.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}ho(e,n.position)}function dN(e,n){if(n.data&&n.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(n.data.estree);ho(e,n.position)}function hN(e,n,s){const r=e.schema;let a=r;n.name==="svg"&&r.space==="html"&&(a=Lf,e.schema=a),e.ancestors.push(n);const o=n.name===null?e.Fragment:gv(e,n.name,!0),c=yN(e,n),u=Df(e,n);return mv(e,c,o,n),qf(c,u),e.ancestors.pop(),e.schema=r,e.create(n,o,c,s)}function pN(e,n,s){const r={};return qf(r,Df(e,n)),e.create(n,e.Fragment,r,s)}function fN(e,n){return n.value}function mv(e,n,s,r){typeof s!="string"&&s!==e.Fragment&&e.passNode&&(n.node=r)}function qf(e,n){if(n.length>0){const s=n.length>1?n:n[0];s&&(e.children=s)}}function mN(e,n,s){return r;function r(a,o,c,u){const p=Array.isArray(c.children)?s:n;return u?p(o,c,u):p(o,c)}}function gN(e,n){return s;function s(r,a,o,c){const u=Array.isArray(o.children),d=_f(r);return n(a,o,c,u,{columnNumber:d?d.column-1:void 0,fileName:e,lineNumber:d?d.line:void 0},void 0)}}function xN(e,n){const s={};let r,a;for(a in n.properties)if(a!=="children"&&Of.call(n.properties,a)){const o=kN(e,a,n.properties[a]);if(o){const[c,u]=o;e.tableCellAlignToStyle&&c==="align"&&typeof u=="string"&&oN.has(n.tagName)?r=u:s[c]=u}}if(r){const o=s.style||(s.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return s}function yN(e,n){const s={};for(const r of n.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const c=o.expression;c.type;const u=c.properties[0];u.type,Object.assign(s,e.evaluater.evaluateExpression(u.argument))}else ho(e,n.position);else{const a=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const u=r.value.data.estree.body[0];u.type,o=e.evaluater.evaluateExpression(u.expression)}else ho(e,n.position);else o=r.value===null?!0:r.value;s[a]=o}return s}function Df(e,n){const s=[];let r=-1;const a=e.passKeys?new Map:rN;for(;++r<n.children.length;){const o=n.children[r];let c;if(e.passKeys){const d=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(d){const p=a.get(d)||0;c=d+"-"+p,a.set(d,p+1)}}const u=fv(e,o,c);u!==void 0&&s.push(u)}return s}function kN(e,n,s){const r=V7(e.schema,n);if(!(s==null||typeof s=="number"&&Number.isNaN(s))){if(Array.isArray(s)&&(s=r.commaSeparated?z7(s):G7(s)),r.property==="style"){let a=typeof s=="object"?s:vN(e,String(s));return e.stylePropertyNameCase==="css"&&(a=jN(a)),["style",a]}return[e.elementAttributeNameCase==="react"&&r.space?W7[r.property]||r.property:r.attribute,s]}}function vN(e,n){try{return nN(n,{reactCompat:!0})}catch(s){if(e.ignoreInvalidStyle)return{};const r=s,a=new qt("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw a.file=e.filePath||void 0,a.url=pv+"#cannot-parse-style-attribute",a}}function gv(e,n,s){let r;if(!s)r={type:"Literal",value:n};else if(n.includes(".")){const a=n.split(".");let o=-1,c;for(;++o<a.length;){const u=Ex(a[o])?{type:"Identifier",name:a[o]}:{type:"Literal",value:a[o]};c=c?{type:"MemberExpression",object:c,property:u,computed:!!(o&&u.type==="Literal"),optional:!1}:u}r=c}else r=Ex(n)&&!/^[a-z]/.test(n)?{type:"Identifier",name:n}:{type:"Literal",value:n};if(r.type==="Literal"){const a=r.value;return Of.call(e.components,a)?e.components[a]:a}if(e.evaluater)return e.evaluater.evaluateExpression(r);ho(e)}function ho(e,n){const s=new qt("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:n,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw s.file=e.filePath||void 0,s.url=pv+"#cannot-handle-mdx-estrees-without-createevaluater",s}function jN(e){const n={};let s;for(s in e)Of.call(e,s)&&(n[bN(s)]=e[s]);return n}function bN(e){let n=e.replace(iN,wN);return n.slice(0,3)==="ms-"&&(n="-"+n),n}function wN(e){return"-"+e.toLowerCase()}const qh={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},NN={};function Bf(e,n){const s=NN,r=typeof s.includeImageAlt=="boolean"?s.includeImageAlt:!0,a=typeof s.includeHtml=="boolean"?s.includeHtml:!0;return xv(e,r,a)}function xv(e,n,s){if(SN(e)){if("value"in e)return e.type==="html"&&!s?"":e.value;if(n&&"alt"in e&&e.alt)return e.alt;if("children"in e)return _x(e.children,n,s)}return Array.isArray(e)?_x(e,n,s):""}function _x(e,n,s){const r=[];let a=-1;for(;++a<e.length;)r[a]=xv(e[a],n,s);return r.join("")}function SN(e){return!!(e&&typeof e=="object")}const Ox=document.createElement("i");function Wf(e){const n="&"+e+";";Ox.innerHTML=n;const s=Ox.textContent;return s.charCodeAt(s.length-1)===59&&e!=="semi"||s===n?!1:s}function kn(e,n,s,r){const a=e.length;let o=0,c;if(n<0?n=-n>a?0:a+n:n=n>a?a:n,s=s>0?s:0,r.length<1e4)c=Array.from(r),c.unshift(n,s),e.splice(...c);else for(s&&e.splice(n,s);o<r.length;)c=r.slice(o,o+1e4),c.unshift(n,0),e.splice(...c),o+=1e4,n+=1e4}function Tn(e,n){return e.length>0?(kn(e,e.length,0,n),e):n}const qx={}.hasOwnProperty;function yv(e){const n={};let s=-1;for(;++s<e.length;)CN(n,e[s]);return n}function CN(e,n){let s;for(s in n){const a=(qx.call(e,s)?e[s]:void 0)||(e[s]={}),o=n[s];let c;if(o)for(c in o){qx.call(a,c)||(a[c]=[]);const u=o[c];$N(a[c],Array.isArray(u)?u:u?[u]:[])}}}function $N(e,n){let s=-1;const r=[];for(;++s<n.length;)(n[s].add==="after"?e:r).push(n[s]);kn(e,0,0,r)}function kv(e,n){const s=Number.parseInt(e,n);return s<9||s===11||s>13&&s<32||s>126&&s<160||s>55295&&s<57344||s>64975&&s<65008||(s&65535)===65535||(s&65535)===65534||s>1114111?"�":String.fromCodePoint(s)}function Hn(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Wt=hr(/[A-Za-z]/),Ft=hr(/[\dA-Za-z]/),EN=hr(/[#-'*+\--9=?A-Z^-~]/);function Bc(e){return e!==null&&(e<32||e===127)}const Up=hr(/\d/),TN=hr(/[\dA-Fa-f]/),AN=hr(/[!-/:-@[-`{-~]/);function Ce(e){return e!==null&&e<-2}function Ye(e){return e!==null&&(e<0||e===32)}function Oe(e){return e===-2||e===-1||e===32}const mu=hr(/\p{P}|\p{S}/u),Dr=hr(/\s/);function hr(e){return n;function n(s){return s!==null&&s>-1&&e.test(String.fromCharCode(s))}}function Qi(e){const n=[];let s=-1,r=0,a=0;for(;++s<e.length;){const o=e.charCodeAt(s);let c="";if(o===37&&Ft(e.charCodeAt(s+1))&&Ft(e.charCodeAt(s+2)))a=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(c=String.fromCharCode(o));else if(o>55295&&o<57344){const u=e.charCodeAt(s+1);o<56320&&u>56319&&u<57344?(c=String.fromCharCode(o,u),a=1):c="�"}else c=String.fromCharCode(o);c&&(n.push(e.slice(r,s),encodeURIComponent(c)),r=s+a+1,c=""),a&&(s+=a,a=0)}return n.join("")+e.slice(r)}function Be(e,n,s,r){const a=r?r-1:Number.POSITIVE_INFINITY;let o=0;return c;function c(d){return Oe(d)?(e.enter(s),u(d)):n(d)}function u(d){return Oe(d)&&o++<a?(e.consume(d),u):(e.exit(s),n(d))}}const PN={tokenize:RN};function RN(e){const n=e.attempt(this.parser.constructs.contentInitial,r,a);let s;return n;function r(u){if(u===null){e.consume(u);return}return e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),Be(e,n,"linePrefix")}function a(u){return e.enter("paragraph"),o(u)}function o(u){const d=e.enter("chunkText",{contentType:"text",previous:s});return s&&(s.next=d),s=d,c(u)}function c(u){if(u===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(u);return}return Ce(u)?(e.consume(u),e.exit("chunkText"),o):(e.consume(u),c)}}const IN={tokenize:zN},Dx={tokenize:MN};function zN(e){const n=this,s=[];let r=0,a,o,c;return u;function u(S){if(r<s.length){const P=s[r];return n.containerState=P[1],e.attempt(P[0].continuation,d,p)(S)}return p(S)}function d(S){if(r++,n.containerState._closeFlow){n.containerState._closeFlow=void 0,a&&C();const P=n.events.length;let M=P,T;for(;M--;)if(n.events[M][0]==="exit"&&n.events[M][1].type==="chunkFlow"){T=n.events[M][1].end;break}N(r);let F=P;for(;F<n.events.length;)n.events[F][1].end={...T},F++;return kn(n.events,M+1,0,n.events.slice(P)),n.events.length=F,p(S)}return u(S)}function p(S){if(r===s.length){if(!a)return y(S);if(a.currentConstruct&&a.currentConstruct.concrete)return k(S);n.interrupt=!!(a.currentConstruct&&!a._gfmTableDynamicInterruptHack)}return n.containerState={},e.check(Dx,f,m)(S)}function f(S){return a&&C(),N(r),y(S)}function m(S){return n.parser.lazy[n.now().line]=r!==s.length,c=n.now().offset,k(S)}function y(S){return n.containerState={},e.attempt(Dx,x,k)(S)}function x(S){return r++,s.push([n.currentConstruct,n.containerState]),y(S)}function k(S){if(S===null){a&&C(),N(0),e.consume(S);return}return a=a||n.parser.flow(n.now()),e.enter("chunkFlow",{_tokenizer:a,contentType:"flow",previous:o}),v(S)}function v(S){if(S===null){b(e.exit("chunkFlow"),!0),N(0),e.consume(S);return}return Ce(S)?(e.consume(S),b(e.exit("chunkFlow")),r=0,n.interrupt=void 0,u):(e.consume(S),v)}function b(S,P){const M=n.sliceStream(S);if(P&&M.push(null),S.previous=o,o&&(o.next=S),o=S,a.defineSkip(S.start),a.write(M),n.parser.lazy[S.start.line]){let T=a.events.length;for(;T--;)if(a.events[T][1].start.offset<c&&(!a.events[T][1].end||a.events[T][1].end.offset>c))return;const F=n.events.length;let R=F,B,I;for(;R--;)if(n.events[R][0]==="exit"&&n.events[R][1].type==="chunkFlow"){if(B){I=n.events[R][1].end;break}B=!0}for(N(r),T=F;T<n.events.length;)n.events[T][1].end={...I},T++;kn(n.events,R+1,0,n.events.slice(F)),n.events.length=T}}function N(S){let P=s.length;for(;P-- >S;){const M=s[P];n.containerState=M[1],M[0].exit.call(n,e)}s.length=S}function C(){a.write([null]),o=void 0,a=void 0,n.containerState._closeFlow=void 0}}function MN(e,n,s){return Be(e,e.attempt(this.parser.constructs.document,n,s),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Fi(e){if(e===null||Ye(e)||Dr(e))return 1;if(mu(e))return 2}function gu(e,n,s){const r=[];let a=-1;for(;++a<e.length;){const o=e[a].resolveAll;o&&!r.includes(o)&&(n=o(n,s),r.push(o))}return n}const Hp={name:"attention",resolveAll:FN,tokenize:LN};function FN(e,n){let s=-1,r,a,o,c,u,d,p,f;for(;++s<e.length;)if(e[s][0]==="enter"&&e[s][1].type==="attentionSequence"&&e[s][1]._close){for(r=s;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&n.sliceSerialize(e[r][1]).charCodeAt(0)===n.sliceSerialize(e[s][1]).charCodeAt(0)){if((e[r][1]._close||e[s][1]._open)&&(e[s][1].end.offset-e[s][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[s][1].end.offset-e[s][1].start.offset)%3))continue;d=e[r][1].end.offset-e[r][1].start.offset>1&&e[s][1].end.offset-e[s][1].start.offset>1?2:1;const m={...e[r][1].end},y={...e[s][1].start};Bx(m,-d),Bx(y,d),c={type:d>1?"strongSequence":"emphasisSequence",start:m,end:{...e[r][1].end}},u={type:d>1?"strongSequence":"emphasisSequence",start:{...e[s][1].start},end:y},o={type:d>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[s][1].start}},a={type:d>1?"strong":"emphasis",start:{...c.start},end:{...u.end}},e[r][1].end={...c.start},e[s][1].start={...u.end},p=[],e[r][1].end.offset-e[r][1].start.offset&&(p=Tn(p,[["enter",e[r][1],n],["exit",e[r][1],n]])),p=Tn(p,[["enter",a,n],["enter",c,n],["exit",c,n],["enter",o,n]]),p=Tn(p,gu(n.parser.constructs.insideSpan.null,e.slice(r+1,s),n)),p=Tn(p,[["exit",o,n],["enter",u,n],["exit",u,n],["exit",a,n]]),e[s][1].end.offset-e[s][1].start.offset?(f=2,p=Tn(p,[["enter",e[s][1],n],["exit",e[s][1],n]])):f=0,kn(e,r-1,s-r+3,p),s=r+p.length-f-2;break}}for(s=-1;++s<e.length;)e[s][1].type==="attentionSequence"&&(e[s][1].type="data");return e}function LN(e,n){const s=this.parser.constructs.attentionMarkers.null,r=this.previous,a=Fi(r);let o;return c;function c(d){return o=d,e.enter("attentionSequence"),u(d)}function u(d){if(d===o)return e.consume(d),u;const p=e.exit("attentionSequence"),f=Fi(d),m=!f||f===2&&a||s.includes(d),y=!a||a===2&&f||s.includes(r);return p._open=!!(o===42?m:m&&(a||!y)),p._close=!!(o===42?y:y&&(f||!m)),n(d)}}function Bx(e,n){e.column+=n,e.offset+=n,e._bufferIndex+=n}const _N={name:"autolink",tokenize:ON};function ON(e,n,s){let r=0;return a;function a(x){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(x),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(x){return Wt(x)?(e.consume(x),c):x===64?s(x):p(x)}function c(x){return x===43||x===45||x===46||Ft(x)?(r=1,u(x)):p(x)}function u(x){return x===58?(e.consume(x),r=0,d):(x===43||x===45||x===46||Ft(x))&&r++<32?(e.consume(x),u):(r=0,p(x))}function d(x){return x===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(x),e.exit("autolinkMarker"),e.exit("autolink"),n):x===null||x===32||x===60||Bc(x)?s(x):(e.consume(x),d)}function p(x){return x===64?(e.consume(x),f):EN(x)?(e.consume(x),p):s(x)}function f(x){return Ft(x)?m(x):s(x)}function m(x){return x===46?(e.consume(x),r=0,f):x===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(x),e.exit("autolinkMarker"),e.exit("autolink"),n):y(x)}function y(x){if((x===45||Ft(x))&&r++<63){const k=x===45?y:m;return e.consume(x),k}return s(x)}}const _o={partial:!0,tokenize:qN};function qN(e,n,s){return r;function r(o){return Oe(o)?Be(e,a,"linePrefix")(o):a(o)}function a(o){return o===null||Ce(o)?n(o):s(o)}}const vv={continuation:{tokenize:BN},exit:WN,name:"blockQuote",tokenize:DN};function DN(e,n,s){const r=this;return a;function a(c){if(c===62){const u=r.containerState;return u.open||(e.enter("blockQuote",{_container:!0}),u.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(c),e.exit("blockQuoteMarker"),o}return s(c)}function o(c){return Oe(c)?(e.enter("blockQuotePrefixWhitespace"),e.consume(c),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),n):(e.exit("blockQuotePrefix"),n(c))}}function BN(e,n,s){const r=this;return a;function a(c){return Oe(c)?Be(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c):o(c)}function o(c){return e.attempt(vv,n,s)(c)}}function WN(e){e.exit("blockQuote")}const jv={name:"characterEscape",tokenize:UN};function UN(e,n,s){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),a}function a(o){return AN(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),n):s(o)}}const bv={name:"characterReference",tokenize:HN};function HN(e,n,s){const r=this;let a=0,o,c;return u;function u(m){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(m),e.exit("characterReferenceMarker"),d}function d(m){return m===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(m),e.exit("characterReferenceMarkerNumeric"),p):(e.enter("characterReferenceValue"),o=31,c=Ft,f(m))}function p(m){return m===88||m===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(m),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,c=TN,f):(e.enter("characterReferenceValue"),o=7,c=Up,f(m))}function f(m){if(m===59&&a){const y=e.exit("characterReferenceValue");return c===Ft&&!Wf(r.sliceSerialize(y))?s(m):(e.enter("characterReferenceMarker"),e.consume(m),e.exit("characterReferenceMarker"),e.exit("characterReference"),n)}return c(m)&&a++<o?(e.consume(m),f):s(m)}}const Wx={partial:!0,tokenize:KN},Ux={concrete:!0,name:"codeFenced",tokenize:VN};function VN(e,n,s){const r=this,a={partial:!0,tokenize:M};let o=0,c=0,u;return d;function d(T){return p(T)}function p(T){const F=r.events[r.events.length-1];return o=F&&F[1].type==="linePrefix"?F[2].sliceSerialize(F[1],!0).length:0,u=T,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),f(T)}function f(T){return T===u?(c++,e.consume(T),f):c<3?s(T):(e.exit("codeFencedFenceSequence"),Oe(T)?Be(e,m,"whitespace")(T):m(T))}function m(T){return T===null||Ce(T)?(e.exit("codeFencedFence"),r.interrupt?n(T):e.check(Wx,v,P)(T)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),y(T))}function y(T){return T===null||Ce(T)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),m(T)):Oe(T)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Be(e,x,"whitespace")(T)):T===96&&T===u?s(T):(e.consume(T),y)}function x(T){return T===null||Ce(T)?m(T):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),k(T))}function k(T){return T===null||Ce(T)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),m(T)):T===96&&T===u?s(T):(e.consume(T),k)}function v(T){return e.attempt(a,P,b)(T)}function b(T){return e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),N}function N(T){return o>0&&Oe(T)?Be(e,C,"linePrefix",o+1)(T):C(T)}function C(T){return T===null||Ce(T)?e.check(Wx,v,P)(T):(e.enter("codeFlowValue"),S(T))}function S(T){return T===null||Ce(T)?(e.exit("codeFlowValue"),C(T)):(e.consume(T),S)}function P(T){return e.exit("codeFenced"),n(T)}function M(T,F,R){let B=0;return I;function I(K){return T.enter("lineEnding"),T.consume(K),T.exit("lineEnding"),O}function O(K){return T.enter("codeFencedFence"),Oe(K)?Be(T,_,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(K):_(K)}function _(K){return K===u?(T.enter("codeFencedFenceSequence"),Q(K)):R(K)}function Q(K){return K===u?(B++,T.consume(K),Q):B>=c?(T.exit("codeFencedFenceSequence"),Oe(K)?Be(T,q,"whitespace")(K):q(K)):R(K)}function q(K){return K===null||Ce(K)?(T.exit("codeFencedFence"),F(K)):R(K)}}}function KN(e,n,s){const r=this;return a;function a(c){return c===null?s(c):(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),o)}function o(c){return r.parser.lazy[r.now().line]?s(c):n(c)}}const Dh={name:"codeIndented",tokenize:QN},YN={partial:!0,tokenize:GN};function QN(e,n,s){const r=this;return a;function a(p){return e.enter("codeIndented"),Be(e,o,"linePrefix",5)(p)}function o(p){const f=r.events[r.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?c(p):s(p)}function c(p){return p===null?d(p):Ce(p)?e.attempt(YN,c,d)(p):(e.enter("codeFlowValue"),u(p))}function u(p){return p===null||Ce(p)?(e.exit("codeFlowValue"),c(p)):(e.consume(p),u)}function d(p){return e.exit("codeIndented"),n(p)}}function GN(e,n,s){const r=this;return a;function a(c){return r.parser.lazy[r.now().line]?s(c):Ce(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),a):Be(e,o,"linePrefix",5)(c)}function o(c){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?n(c):Ce(c)?a(c):s(c)}}const ZN={name:"codeText",previous:JN,resolve:XN,tokenize:e9};function XN(e){let n=e.length-4,s=3,r,a;if((e[s][1].type==="lineEnding"||e[s][1].type==="space")&&(e[n][1].type==="lineEnding"||e[n][1].type==="space")){for(r=s;++r<n;)if(e[r][1].type==="codeTextData"){e[s][1].type="codeTextPadding",e[n][1].type="codeTextPadding",s+=2,n-=2;break}}for(r=s-1,n++;++r<=n;)a===void 0?r!==n&&e[r][1].type!=="lineEnding"&&(a=r):(r===n||e[r][1].type==="lineEnding")&&(e[a][1].type="codeTextData",r!==a+2&&(e[a][1].end=e[r-1][1].end,e.splice(a+2,r-a-2),n-=r-a-2,r=a+2),a=void 0);return e}function JN(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function e9(e,n,s){let r=0,a,o;return c;function c(m){return e.enter("codeText"),e.enter("codeTextSequence"),u(m)}function u(m){return m===96?(e.consume(m),r++,u):(e.exit("codeTextSequence"),d(m))}function d(m){return m===null?s(m):m===32?(e.enter("space"),e.consume(m),e.exit("space"),d):m===96?(o=e.enter("codeTextSequence"),a=0,f(m)):Ce(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),d):(e.enter("codeTextData"),p(m))}function p(m){return m===null||m===32||m===96||Ce(m)?(e.exit("codeTextData"),d(m)):(e.consume(m),p)}function f(m){return m===96?(e.consume(m),a++,f):a===r?(e.exit("codeTextSequence"),e.exit("codeText"),n(m)):(o.type="codeTextData",p(m))}}class t9{constructor(n){this.left=n?[...n]:[],this.right=[]}get(n){if(n<0||n>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+n+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return n<this.left.length?this.left[n]:this.right[this.right.length-n+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(n,s){const r=s??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(n,r):n>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-n+this.left.length).reverse():this.left.slice(n).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(n,s,r){const a=s||0;this.setCursor(Math.trunc(n));const o=this.right.splice(this.right.length-a,Number.POSITIVE_INFINITY);return r&&Ba(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(n){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(n)}pushMany(n){this.setCursor(Number.POSITIVE_INFINITY),Ba(this.left,n)}unshift(n){this.setCursor(0),this.right.push(n)}unshiftMany(n){this.setCursor(0),Ba(this.right,n.reverse())}setCursor(n){if(!(n===this.left.length||n>this.left.length&&this.right.length===0||n<0&&this.left.length===0))if(n<this.left.length){const s=this.left.splice(n,Number.POSITIVE_INFINITY);Ba(this.right,s.reverse())}else{const s=this.right.splice(this.left.length+this.right.length-n,Number.POSITIVE_INFINITY);Ba(this.left,s.reverse())}}}function Ba(e,n){let s=0;if(n.length<1e4)e.push(...n);else for(;s<n.length;)e.push(...n.slice(s,s+1e4)),s+=1e4}function wv(e){const n={};let s=-1,r,a,o,c,u,d,p;const f=new t9(e);for(;++s<f.length;){for(;s in n;)s=n[s];if(r=f.get(s),s&&r[1].type==="chunkFlow"&&f.get(s-1)[1].type==="listItemPrefix"&&(d=r[1]._tokenizer.events,o=0,o<d.length&&d[o][1].type==="lineEndingBlank"&&(o+=2),o<d.length&&d[o][1].type==="content"))for(;++o<d.length&&d[o][1].type!=="content";)d[o][1].type==="chunkText"&&(d[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(n,n9(f,s)),s=n[s],p=!0);else if(r[1]._container){for(o=s,a=void 0;o--;)if(c=f.get(o),c[1].type==="lineEnding"||c[1].type==="lineEndingBlank")c[0]==="enter"&&(a&&(f.get(a)[1].type="lineEndingBlank"),c[1].type="lineEnding",a=o);else if(!(c[1].type==="linePrefix"||c[1].type==="listItemIndent"))break;a&&(r[1].end={...f.get(a)[1].start},u=f.slice(a,s),u.unshift(r),f.splice(a,s-a+1,u))}}return kn(e,0,Number.POSITIVE_INFINITY,f.slice(0)),!p}function n9(e,n){const s=e.get(n)[1],r=e.get(n)[2];let a=n-1;const o=[];let c=s._tokenizer;c||(c=r.parser[s.contentType](s.start),s._contentTypeTextTrailing&&(c._contentTypeTextTrailing=!0));const u=c.events,d=[],p={};let f,m,y=-1,x=s,k=0,v=0;const b=[v];for(;x;){for(;e.get(++a)[1]!==x;);o.push(a),x._tokenizer||(f=r.sliceStream(x),x.next||f.push(null),m&&c.defineSkip(x.start),x._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=!0),c.write(f),x._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=void 0)),m=x,x=x.next}for(x=s;++y<u.length;)u[y][0]==="exit"&&u[y-1][0]==="enter"&&u[y][1].type===u[y-1][1].type&&u[y][1].start.line!==u[y][1].end.line&&(v=y+1,b.push(v),x._tokenizer=void 0,x.previous=void 0,x=x.next);for(c.events=[],x?(x._tokenizer=void 0,x.previous=void 0):b.pop(),y=b.length;y--;){const N=u.slice(b[y],b[y+1]),C=o.pop();d.push([C,C+N.length-1]),e.splice(C,2,N)}for(d.reverse(),y=-1;++y<d.length;)p[k+d[y][0]]=k+d[y][1],k+=d[y][1]-d[y][0]-1;return p}const s9={resolve:i9,tokenize:a9},r9={partial:!0,tokenize:o9};function i9(e){return wv(e),e}function a9(e,n){let s;return r;function r(u){return e.enter("content"),s=e.enter("chunkContent",{contentType:"content"}),a(u)}function a(u){return u===null?o(u):Ce(u)?e.check(r9,c,o)(u):(e.consume(u),a)}function o(u){return e.exit("chunkContent"),e.exit("content"),n(u)}function c(u){return e.consume(u),e.exit("chunkContent"),s.next=e.enter("chunkContent",{contentType:"content",previous:s}),s=s.next,a}}function o9(e,n,s){const r=this;return a;function a(c){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),Be(e,o,"linePrefix")}function o(c){if(c===null||Ce(c))return s(c);const u=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?n(c):e.interrupt(r.parser.constructs.flow,s,n)(c)}}function Nv(e,n,s,r,a,o,c,u,d){const p=d||Number.POSITIVE_INFINITY;let f=0;return m;function m(N){return N===60?(e.enter(r),e.enter(a),e.enter(o),e.consume(N),e.exit(o),y):N===null||N===32||N===41||Bc(N)?s(N):(e.enter(r),e.enter(c),e.enter(u),e.enter("chunkString",{contentType:"string"}),v(N))}function y(N){return N===62?(e.enter(o),e.consume(N),e.exit(o),e.exit(a),e.exit(r),n):(e.enter(u),e.enter("chunkString",{contentType:"string"}),x(N))}function x(N){return N===62?(e.exit("chunkString"),e.exit(u),y(N)):N===null||N===60||Ce(N)?s(N):(e.consume(N),N===92?k:x)}function k(N){return N===60||N===62||N===92?(e.consume(N),x):x(N)}function v(N){return!f&&(N===null||N===41||Ye(N))?(e.exit("chunkString"),e.exit(u),e.exit(c),e.exit(r),n(N)):f<p&&N===40?(e.consume(N),f++,v):N===41?(e.consume(N),f--,v):N===null||N===32||N===40||Bc(N)?s(N):(e.consume(N),N===92?b:v)}function b(N){return N===40||N===41||N===92?(e.consume(N),v):v(N)}}function Sv(e,n,s,r,a,o){const c=this;let u=0,d;return p;function p(x){return e.enter(r),e.enter(a),e.consume(x),e.exit(a),e.enter(o),f}function f(x){return u>999||x===null||x===91||x===93&&!d||x===94&&!u&&"_hiddenFootnoteSupport"in c.parser.constructs?s(x):x===93?(e.exit(o),e.enter(a),e.consume(x),e.exit(a),e.exit(r),n):Ce(x)?(e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),f):(e.enter("chunkString",{contentType:"string"}),m(x))}function m(x){return x===null||x===91||x===93||Ce(x)||u++>999?(e.exit("chunkString"),f(x)):(e.consume(x),d||(d=!Oe(x)),x===92?y:m)}function y(x){return x===91||x===92||x===93?(e.consume(x),u++,m):m(x)}}function Cv(e,n,s,r,a,o){let c;return u;function u(y){return y===34||y===39||y===40?(e.enter(r),e.enter(a),e.consume(y),e.exit(a),c=y===40?41:y,d):s(y)}function d(y){return y===c?(e.enter(a),e.consume(y),e.exit(a),e.exit(r),n):(e.enter(o),p(y))}function p(y){return y===c?(e.exit(o),d(c)):y===null?s(y):Ce(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),Be(e,p,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),f(y))}function f(y){return y===c||y===null||Ce(y)?(e.exit("chunkString"),p(y)):(e.consume(y),y===92?m:f)}function m(y){return y===c||y===92?(e.consume(y),f):f(y)}}function Qa(e,n){let s;return r;function r(a){return Ce(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),s=!0,r):Oe(a)?Be(e,r,s?"linePrefix":"lineSuffix")(a):n(a)}}const l9={name:"definition",tokenize:u9},c9={partial:!0,tokenize:d9};function u9(e,n,s){const r=this;let a;return o;function o(x){return e.enter("definition"),c(x)}function c(x){return Sv.call(r,e,u,s,"definitionLabel","definitionLabelMarker","definitionLabelString")(x)}function u(x){return a=Hn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),x===58?(e.enter("definitionMarker"),e.consume(x),e.exit("definitionMarker"),d):s(x)}function d(x){return Ye(x)?Qa(e,p)(x):p(x)}function p(x){return Nv(e,f,s,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(x)}function f(x){return e.attempt(c9,m,m)(x)}function m(x){return Oe(x)?Be(e,y,"whitespace")(x):y(x)}function y(x){return x===null||Ce(x)?(e.exit("definition"),r.parser.defined.push(a),n(x)):s(x)}}function d9(e,n,s){return r;function r(u){return Ye(u)?Qa(e,a)(u):s(u)}function a(u){return Cv(e,o,s,"definitionTitle","definitionTitleMarker","definitionTitleString")(u)}function o(u){return Oe(u)?Be(e,c,"whitespace")(u):c(u)}function c(u){return u===null||Ce(u)?n(u):s(u)}}const h9={name:"hardBreakEscape",tokenize:p9};function p9(e,n,s){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),a}function a(o){return Ce(o)?(e.exit("hardBreakEscape"),n(o)):s(o)}}const f9={name:"headingAtx",resolve:m9,tokenize:g9};function m9(e,n){let s=e.length-2,r=3,a,o;return e[r][1].type==="whitespace"&&(r+=2),s-2>r&&e[s][1].type==="whitespace"&&(s-=2),e[s][1].type==="atxHeadingSequence"&&(r===s-1||s-4>r&&e[s-2][1].type==="whitespace")&&(s-=r+1===s?2:4),s>r&&(a={type:"atxHeadingText",start:e[r][1].start,end:e[s][1].end},o={type:"chunkText",start:e[r][1].start,end:e[s][1].end,contentType:"text"},kn(e,r,s-r+1,[["enter",a,n],["enter",o,n],["exit",o,n],["exit",a,n]])),e}function g9(e,n,s){let r=0;return a;function a(f){return e.enter("atxHeading"),o(f)}function o(f){return e.enter("atxHeadingSequence"),c(f)}function c(f){return f===35&&r++<6?(e.consume(f),c):f===null||Ye(f)?(e.exit("atxHeadingSequence"),u(f)):s(f)}function u(f){return f===35?(e.enter("atxHeadingSequence"),d(f)):f===null||Ce(f)?(e.exit("atxHeading"),n(f)):Oe(f)?Be(e,u,"whitespace")(f):(e.enter("atxHeadingText"),p(f))}function d(f){return f===35?(e.consume(f),d):(e.exit("atxHeadingSequence"),u(f))}function p(f){return f===null||f===35||Ye(f)?(e.exit("atxHeadingText"),u(f)):(e.consume(f),p)}}const x9=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Hx=["pre","script","style","textarea"],y9={concrete:!0,name:"htmlFlow",resolveTo:j9,tokenize:b9},k9={partial:!0,tokenize:N9},v9={partial:!0,tokenize:w9};function j9(e){let n=e.length;for(;n--&&!(e[n][0]==="enter"&&e[n][1].type==="htmlFlow"););return n>1&&e[n-2][1].type==="linePrefix"&&(e[n][1].start=e[n-2][1].start,e[n+1][1].start=e[n-2][1].start,e.splice(n-2,2)),e}function b9(e,n,s){const r=this;let a,o,c,u,d;return p;function p(z){return f(z)}function f(z){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(z),m}function m(z){return z===33?(e.consume(z),y):z===47?(e.consume(z),o=!0,v):z===63?(e.consume(z),a=3,r.interrupt?n:A):Wt(z)?(e.consume(z),c=String.fromCharCode(z),b):s(z)}function y(z){return z===45?(e.consume(z),a=2,x):z===91?(e.consume(z),a=5,u=0,k):Wt(z)?(e.consume(z),a=4,r.interrupt?n:A):s(z)}function x(z){return z===45?(e.consume(z),r.interrupt?n:A):s(z)}function k(z){const me="CDATA[";return z===me.charCodeAt(u++)?(e.consume(z),u===me.length?r.interrupt?n:_:k):s(z)}function v(z){return Wt(z)?(e.consume(z),c=String.fromCharCode(z),b):s(z)}function b(z){if(z===null||z===47||z===62||Ye(z)){const me=z===47,he=c.toLowerCase();return!me&&!o&&Hx.includes(he)?(a=1,r.interrupt?n(z):_(z)):x9.includes(c.toLowerCase())?(a=6,me?(e.consume(z),N):r.interrupt?n(z):_(z)):(a=7,r.interrupt&&!r.parser.lazy[r.now().line]?s(z):o?C(z):S(z))}return z===45||Ft(z)?(e.consume(z),c+=String.fromCharCode(z),b):s(z)}function N(z){return z===62?(e.consume(z),r.interrupt?n:_):s(z)}function C(z){return Oe(z)?(e.consume(z),C):I(z)}function S(z){return z===47?(e.consume(z),I):z===58||z===95||Wt(z)?(e.consume(z),P):Oe(z)?(e.consume(z),S):I(z)}function P(z){return z===45||z===46||z===58||z===95||Ft(z)?(e.consume(z),P):M(z)}function M(z){return z===61?(e.consume(z),T):Oe(z)?(e.consume(z),M):S(z)}function T(z){return z===null||z===60||z===61||z===62||z===96?s(z):z===34||z===39?(e.consume(z),d=z,F):Oe(z)?(e.consume(z),T):R(z)}function F(z){return z===d?(e.consume(z),d=null,B):z===null||Ce(z)?s(z):(e.consume(z),F)}function R(z){return z===null||z===34||z===39||z===47||z===60||z===61||z===62||z===96||Ye(z)?M(z):(e.consume(z),R)}function B(z){return z===47||z===62||Oe(z)?S(z):s(z)}function I(z){return z===62?(e.consume(z),O):s(z)}function O(z){return z===null||Ce(z)?_(z):Oe(z)?(e.consume(z),O):s(z)}function _(z){return z===45&&a===2?(e.consume(z),ce):z===60&&a===1?(e.consume(z),H):z===62&&a===4?(e.consume(z),D):z===63&&a===3?(e.consume(z),A):z===93&&a===5?(e.consume(z),ne):Ce(z)&&(a===6||a===7)?(e.exit("htmlFlowData"),e.check(k9,ee,Q)(z)):z===null||Ce(z)?(e.exit("htmlFlowData"),Q(z)):(e.consume(z),_)}function Q(z){return e.check(v9,q,ee)(z)}function q(z){return e.enter("lineEnding"),e.consume(z),e.exit("lineEnding"),K}function K(z){return z===null||Ce(z)?Q(z):(e.enter("htmlFlowData"),_(z))}function ce(z){return z===45?(e.consume(z),A):_(z)}function H(z){return z===47?(e.consume(z),c="",V):_(z)}function V(z){if(z===62){const me=c.toLowerCase();return Hx.includes(me)?(e.consume(z),D):_(z)}return Wt(z)&&c.length<8?(e.consume(z),c+=String.fromCharCode(z),V):_(z)}function ne(z){return z===93?(e.consume(z),A):_(z)}function A(z){return z===62?(e.consume(z),D):z===45&&a===2?(e.consume(z),A):_(z)}function D(z){return z===null||Ce(z)?(e.exit("htmlFlowData"),ee(z)):(e.consume(z),D)}function ee(z){return e.exit("htmlFlow"),n(z)}}function w9(e,n,s){const r=this;return a;function a(c){return Ce(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),o):s(c)}function o(c){return r.parser.lazy[r.now().line]?s(c):n(c)}}function N9(e,n,s){return r;function r(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),e.attempt(_o,n,s)}}const S9={name:"htmlText",tokenize:C9};function C9(e,n,s){const r=this;let a,o,c;return u;function u(A){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(A),d}function d(A){return A===33?(e.consume(A),p):A===47?(e.consume(A),M):A===63?(e.consume(A),S):Wt(A)?(e.consume(A),R):s(A)}function p(A){return A===45?(e.consume(A),f):A===91?(e.consume(A),o=0,k):Wt(A)?(e.consume(A),C):s(A)}function f(A){return A===45?(e.consume(A),x):s(A)}function m(A){return A===null?s(A):A===45?(e.consume(A),y):Ce(A)?(c=m,H(A)):(e.consume(A),m)}function y(A){return A===45?(e.consume(A),x):m(A)}function x(A){return A===62?ce(A):A===45?y(A):m(A)}function k(A){const D="CDATA[";return A===D.charCodeAt(o++)?(e.consume(A),o===D.length?v:k):s(A)}function v(A){return A===null?s(A):A===93?(e.consume(A),b):Ce(A)?(c=v,H(A)):(e.consume(A),v)}function b(A){return A===93?(e.consume(A),N):v(A)}function N(A){return A===62?ce(A):A===93?(e.consume(A),N):v(A)}function C(A){return A===null||A===62?ce(A):Ce(A)?(c=C,H(A)):(e.consume(A),C)}function S(A){return A===null?s(A):A===63?(e.consume(A),P):Ce(A)?(c=S,H(A)):(e.consume(A),S)}function P(A){return A===62?ce(A):S(A)}function M(A){return Wt(A)?(e.consume(A),T):s(A)}function T(A){return A===45||Ft(A)?(e.consume(A),T):F(A)}function F(A){return Ce(A)?(c=F,H(A)):Oe(A)?(e.consume(A),F):ce(A)}function R(A){return A===45||Ft(A)?(e.consume(A),R):A===47||A===62||Ye(A)?B(A):s(A)}function B(A){return A===47?(e.consume(A),ce):A===58||A===95||Wt(A)?(e.consume(A),I):Ce(A)?(c=B,H(A)):Oe(A)?(e.consume(A),B):ce(A)}function I(A){return A===45||A===46||A===58||A===95||Ft(A)?(e.consume(A),I):O(A)}function O(A){return A===61?(e.consume(A),_):Ce(A)?(c=O,H(A)):Oe(A)?(e.consume(A),O):B(A)}function _(A){return A===null||A===60||A===61||A===62||A===96?s(A):A===34||A===39?(e.consume(A),a=A,Q):Ce(A)?(c=_,H(A)):Oe(A)?(e.consume(A),_):(e.consume(A),q)}function Q(A){return A===a?(e.consume(A),a=void 0,K):A===null?s(A):Ce(A)?(c=Q,H(A)):(e.consume(A),Q)}function q(A){return A===null||A===34||A===39||A===60||A===61||A===96?s(A):A===47||A===62||Ye(A)?B(A):(e.consume(A),q)}function K(A){return A===47||A===62||Ye(A)?B(A):s(A)}function ce(A){return A===62?(e.consume(A),e.exit("htmlTextData"),e.exit("htmlText"),n):s(A)}function H(A){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),V}function V(A){return Oe(A)?Be(e,ne,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(A):ne(A)}function ne(A){return e.enter("htmlTextData"),c(A)}}const Uf={name:"labelEnd",resolveAll:A9,resolveTo:P9,tokenize:R9},$9={tokenize:I9},E9={tokenize:z9},T9={tokenize:M9};function A9(e){let n=-1;const s=[];for(;++n<e.length;){const r=e[n][1];if(s.push(e[n]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const a=r.type==="labelImage"?4:2;r.type="data",n+=a}}return e.length!==s.length&&kn(e,0,e.length,s),e}function P9(e,n){let s=e.length,r=0,a,o,c,u;for(;s--;)if(a=e[s][1],o){if(a.type==="link"||a.type==="labelLink"&&a._inactive)break;e[s][0]==="enter"&&a.type==="labelLink"&&(a._inactive=!0)}else if(c){if(e[s][0]==="enter"&&(a.type==="labelImage"||a.type==="labelLink")&&!a._balanced&&(o=s,a.type!=="labelLink")){r=2;break}}else a.type==="labelEnd"&&(c=s);const d={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},p={type:"label",start:{...e[o][1].start},end:{...e[c][1].end}},f={type:"labelText",start:{...e[o+r+2][1].end},end:{...e[c-2][1].start}};return u=[["enter",d,n],["enter",p,n]],u=Tn(u,e.slice(o+1,o+r+3)),u=Tn(u,[["enter",f,n]]),u=Tn(u,gu(n.parser.constructs.insideSpan.null,e.slice(o+r+4,c-3),n)),u=Tn(u,[["exit",f,n],e[c-2],e[c-1],["exit",p,n]]),u=Tn(u,e.slice(c+1)),u=Tn(u,[["exit",d,n]]),kn(e,o,e.length,u),e}function R9(e,n,s){const r=this;let a=r.events.length,o,c;for(;a--;)if((r.events[a][1].type==="labelImage"||r.events[a][1].type==="labelLink")&&!r.events[a][1]._balanced){o=r.events[a][1];break}return u;function u(y){return o?o._inactive?m(y):(c=r.parser.defined.includes(Hn(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(y),e.exit("labelMarker"),e.exit("labelEnd"),d):s(y)}function d(y){return y===40?e.attempt($9,f,c?f:m)(y):y===91?e.attempt(E9,f,c?p:m)(y):c?f(y):m(y)}function p(y){return e.attempt(T9,f,m)(y)}function f(y){return n(y)}function m(y){return o._balanced=!0,s(y)}}function I9(e,n,s){return r;function r(m){return e.enter("resource"),e.enter("resourceMarker"),e.consume(m),e.exit("resourceMarker"),a}function a(m){return Ye(m)?Qa(e,o)(m):o(m)}function o(m){return m===41?f(m):Nv(e,c,u,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(m)}function c(m){return Ye(m)?Qa(e,d)(m):f(m)}function u(m){return s(m)}function d(m){return m===34||m===39||m===40?Cv(e,p,s,"resourceTitle","resourceTitleMarker","resourceTitleString")(m):f(m)}function p(m){return Ye(m)?Qa(e,f)(m):f(m)}function f(m){return m===41?(e.enter("resourceMarker"),e.consume(m),e.exit("resourceMarker"),e.exit("resource"),n):s(m)}}function z9(e,n,s){const r=this;return a;function a(u){return Sv.call(r,e,o,c,"reference","referenceMarker","referenceString")(u)}function o(u){return r.parser.defined.includes(Hn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?n(u):s(u)}function c(u){return s(u)}}function M9(e,n,s){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),a}function a(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),n):s(o)}}const F9={name:"labelStartImage",resolveAll:Uf.resolveAll,tokenize:L9};function L9(e,n,s){const r=this;return a;function a(u){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(u),e.exit("labelImageMarker"),o}function o(u){return u===91?(e.enter("labelMarker"),e.consume(u),e.exit("labelMarker"),e.exit("labelImage"),c):s(u)}function c(u){return u===94&&"_hiddenFootnoteSupport"in r.parser.constructs?s(u):n(u)}}const _9={name:"labelStartLink",resolveAll:Uf.resolveAll,tokenize:O9};function O9(e,n,s){const r=this;return a;function a(c){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(c),e.exit("labelMarker"),e.exit("labelLink"),o}function o(c){return c===94&&"_hiddenFootnoteSupport"in r.parser.constructs?s(c):n(c)}}const Bh={name:"lineEnding",tokenize:q9};function q9(e,n){return s;function s(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Be(e,n,"linePrefix")}}const vc={name:"thematicBreak",tokenize:D9};function D9(e,n,s){let r=0,a;return o;function o(p){return e.enter("thematicBreak"),c(p)}function c(p){return a=p,u(p)}function u(p){return p===a?(e.enter("thematicBreakSequence"),d(p)):r>=3&&(p===null||Ce(p))?(e.exit("thematicBreak"),n(p)):s(p)}function d(p){return p===a?(e.consume(p),r++,d):(e.exit("thematicBreakSequence"),Oe(p)?Be(e,u,"whitespace")(p):u(p))}}const Jt={continuation:{tokenize:H9},exit:K9,name:"list",tokenize:U9},B9={partial:!0,tokenize:Y9},W9={partial:!0,tokenize:V9};function U9(e,n,s){const r=this,a=r.events[r.events.length-1];let o=a&&a[1].type==="linePrefix"?a[2].sliceSerialize(a[1],!0).length:0,c=0;return u;function u(x){const k=r.containerState.type||(x===42||x===43||x===45?"listUnordered":"listOrdered");if(k==="listUnordered"?!r.containerState.marker||x===r.containerState.marker:Up(x)){if(r.containerState.type||(r.containerState.type=k,e.enter(k,{_container:!0})),k==="listUnordered")return e.enter("listItemPrefix"),x===42||x===45?e.check(vc,s,p)(x):p(x);if(!r.interrupt||x===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),d(x)}return s(x)}function d(x){return Up(x)&&++c<10?(e.consume(x),d):(!r.interrupt||c<2)&&(r.containerState.marker?x===r.containerState.marker:x===41||x===46)?(e.exit("listItemValue"),p(x)):s(x)}function p(x){return e.enter("listItemMarker"),e.consume(x),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||x,e.check(_o,r.interrupt?s:f,e.attempt(B9,y,m))}function f(x){return r.containerState.initialBlankLine=!0,o++,y(x)}function m(x){return Oe(x)?(e.enter("listItemPrefixWhitespace"),e.consume(x),e.exit("listItemPrefixWhitespace"),y):s(x)}function y(x){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,n(x)}}function H9(e,n,s){const r=this;return r.containerState._closeFlow=void 0,e.check(_o,a,o);function a(u){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Be(e,n,"listItemIndent",r.containerState.size+1)(u)}function o(u){return r.containerState.furtherBlankLines||!Oe(u)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,c(u)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(W9,n,c)(u))}function c(u){return r.containerState._closeFlow=!0,r.interrupt=void 0,Be(e,e.attempt(Jt,n,s),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u)}}function V9(e,n,s){const r=this;return Be(e,a,"listItemIndent",r.containerState.size+1);function a(o){const c=r.events[r.events.length-1];return c&&c[1].type==="listItemIndent"&&c[2].sliceSerialize(c[1],!0).length===r.containerState.size?n(o):s(o)}}function K9(e){e.exit(this.containerState.type)}function Y9(e,n,s){const r=this;return Be(e,a,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function a(o){const c=r.events[r.events.length-1];return!Oe(o)&&c&&c[1].type==="listItemPrefixWhitespace"?n(o):s(o)}}const Vx={name:"setextUnderline",resolveTo:Q9,tokenize:G9};function Q9(e,n){let s=e.length,r,a,o;for(;s--;)if(e[s][0]==="enter"){if(e[s][1].type==="content"){r=s;break}e[s][1].type==="paragraph"&&(a=s)}else e[s][1].type==="content"&&e.splice(s,1),!o&&e[s][1].type==="definition"&&(o=s);const c={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[a][1].type="setextHeadingText",o?(e.splice(a,0,["enter",c,n]),e.splice(o+1,0,["exit",e[r][1],n]),e[r][1].end={...e[o][1].end}):e[r][1]=c,e.push(["exit",c,n]),e}function G9(e,n,s){const r=this;let a;return o;function o(p){let f=r.events.length,m;for(;f--;)if(r.events[f][1].type!=="lineEnding"&&r.events[f][1].type!=="linePrefix"&&r.events[f][1].type!=="content"){m=r.events[f][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||m)?(e.enter("setextHeadingLine"),a=p,c(p)):s(p)}function c(p){return e.enter("setextHeadingLineSequence"),u(p)}function u(p){return p===a?(e.consume(p),u):(e.exit("setextHeadingLineSequence"),Oe(p)?Be(e,d,"lineSuffix")(p):d(p))}function d(p){return p===null||Ce(p)?(e.exit("setextHeadingLine"),n(p)):s(p)}}const Z9={tokenize:X9};function X9(e){const n=this,s=e.attempt(_o,r,e.attempt(this.parser.constructs.flowInitial,a,Be(e,e.attempt(this.parser.constructs.flow,a,e.attempt(s9,a)),"linePrefix")));return s;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),n.currentConstruct=void 0,s}function a(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n.currentConstruct=void 0,s}}const J9={resolveAll:Ev()},eS=$v("string"),tS=$v("text");function $v(e){return{resolveAll:Ev(e==="text"?nS:void 0),tokenize:n};function n(s){const r=this,a=this.parser.constructs[e],o=s.attempt(a,c,u);return c;function c(f){return p(f)?o(f):u(f)}function u(f){if(f===null){s.consume(f);return}return s.enter("data"),s.consume(f),d}function d(f){return p(f)?(s.exit("data"),o(f)):(s.consume(f),d)}function p(f){if(f===null)return!0;const m=a[f];let y=-1;if(m)for(;++y<m.length;){const x=m[y];if(!x.previous||x.previous.call(r,r.previous))return!0}return!1}}}function Ev(e){return n;function n(s,r){let a=-1,o;for(;++a<=s.length;)o===void 0?s[a]&&s[a][1].type==="data"&&(o=a,a++):(!s[a]||s[a][1].type!=="data")&&(a!==o+2&&(s[o][1].end=s[a-1][1].end,s.splice(o+2,a-o-2),a=o+2),o=void 0);return e?e(s,r):s}}function nS(e,n){let s=0;for(;++s<=e.length;)if((s===e.length||e[s][1].type==="lineEnding")&&e[s-1][1].type==="data"){const r=e[s-1][1],a=n.sliceStream(r);let o=a.length,c=-1,u=0,d;for(;o--;){const p=a[o];if(typeof p=="string"){for(c=p.length;p.charCodeAt(c-1)===32;)u++,c--;if(c)break;c=-1}else if(p===-2)d=!0,u++;else if(p!==-1){o++;break}}if(n._contentTypeTextTrailing&&s===e.length&&(u=0),u){const p={type:s===e.length||d||u<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?c:r.start._bufferIndex+c,_index:r.start._index+o,line:r.end.line,column:r.end.column-u,offset:r.end.offset-u},end:{...r.end}};r.end={...p.start},r.start.offset===r.end.offset?Object.assign(r,p):(e.splice(s,0,["enter",p,n],["exit",p,n]),s+=2)}s++}return e}const sS={42:Jt,43:Jt,45:Jt,48:Jt,49:Jt,50:Jt,51:Jt,52:Jt,53:Jt,54:Jt,55:Jt,56:Jt,57:Jt,62:vv},rS={91:l9},iS={[-2]:Dh,[-1]:Dh,32:Dh},aS={35:f9,42:vc,45:[Vx,vc],60:y9,61:Vx,95:vc,96:Ux,126:Ux},oS={38:bv,92:jv},lS={[-5]:Bh,[-4]:Bh,[-3]:Bh,33:F9,38:bv,42:Hp,60:[_N,S9],91:_9,92:[h9,jv],93:Uf,95:Hp,96:ZN},cS={null:[Hp,J9]},uS={null:[42,95]},dS={null:[]},hS=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:uS,contentInitial:rS,disable:dS,document:sS,flow:aS,flowInitial:iS,insideSpan:cS,string:oS,text:lS},Symbol.toStringTag,{value:"Module"}));function pS(e,n,s){let r={_bufferIndex:-1,_index:0,line:s&&s.line||1,column:s&&s.column||1,offset:s&&s.offset||0};const a={},o=[];let c=[],u=[];const d={attempt:F(M),check:F(T),consume:C,enter:S,exit:P,interrupt:F(T,{interrupt:!0})},p={code:null,containerState:{},defineSkip:v,events:[],now:k,parser:e,previous:null,sliceSerialize:y,sliceStream:x,write:m};let f=n.tokenize.call(p,d);return n.resolveAll&&o.push(n),p;function m(O){return c=Tn(c,O),b(),c[c.length-1]!==null?[]:(R(n,0),p.events=gu(o,p.events,p),p.events)}function y(O,_){return mS(x(O),_)}function x(O){return fS(c,O)}function k(){const{_bufferIndex:O,_index:_,line:Q,column:q,offset:K}=r;return{_bufferIndex:O,_index:_,line:Q,column:q,offset:K}}function v(O){a[O.line]=O.column,I()}function b(){let O;for(;r._index<c.length;){const _=c[r._index];if(typeof _=="string")for(O=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===O&&r._bufferIndex<_.length;)N(_.charCodeAt(r._bufferIndex));else N(_)}}function N(O){f=f(O)}function C(O){Ce(O)?(r.line++,r.column=1,r.offset+=O===-3?2:1,I()):O!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===c[r._index].length&&(r._bufferIndex=-1,r._index++)),p.previous=O}function S(O,_){const Q=_||{};return Q.type=O,Q.start=k(),p.events.push(["enter",Q,p]),u.push(Q),Q}function P(O){const _=u.pop();return _.end=k(),p.events.push(["exit",_,p]),_}function M(O,_){R(O,_.from)}function T(O,_){_.restore()}function F(O,_){return Q;function Q(q,K,ce){let H,V,ne,A;return Array.isArray(q)?ee(q):"tokenize"in q?ee([q]):D(q);function D(ke){return Re;function Re(Ae){const $e=Ae!==null&&ke[Ae],De=Ae!==null&&ke.null,ct=[...Array.isArray($e)?$e:$e?[$e]:[],...Array.isArray(De)?De:De?[De]:[]];return ee(ct)(Ae)}}function ee(ke){return H=ke,V=0,ke.length===0?ce:z(ke[V])}function z(ke){return Re;function Re(Ae){return A=B(),ne=ke,ke.partial||(p.currentConstruct=ke),ke.name&&p.parser.constructs.disable.null.includes(ke.name)?he():ke.tokenize.call(_?Object.assign(Object.create(p),_):p,d,me,he)(Ae)}}function me(ke){return O(ne,A),K}function he(ke){return A.restore(),++V<H.length?z(H[V]):ce}}}function R(O,_){O.resolveAll&&!o.includes(O)&&o.push(O),O.resolve&&kn(p.events,_,p.events.length-_,O.resolve(p.events.slice(_),p)),O.resolveTo&&(p.events=O.resolveTo(p.events,p))}function B(){const O=k(),_=p.previous,Q=p.currentConstruct,q=p.events.length,K=Array.from(u);return{from:q,restore:ce};function ce(){r=O,p.previous=_,p.currentConstruct=Q,p.events.length=q,u=K,I()}}function I(){r.line in a&&r.column<2&&(r.column=a[r.line],r.offset+=a[r.line]-1)}}function fS(e,n){const s=n.start._index,r=n.start._bufferIndex,a=n.end._index,o=n.end._bufferIndex;let c;if(s===a)c=[e[s].slice(r,o)];else{if(c=e.slice(s,a),r>-1){const u=c[0];typeof u=="string"?c[0]=u.slice(r):c.shift()}o>0&&c.push(e[a].slice(0,o))}return c}function mS(e,n){let s=-1;const r=[];let a;for(;++s<e.length;){const o=e[s];let c;if(typeof o=="string")c=o;else switch(o){case-5:{c="\r";break}case-4:{c=`
564
- `;break}case-3:{c=`\r
565
- `;break}case-2:{c=n?" ":" ";break}case-1:{if(!n&&a)continue;c=" ";break}default:c=String.fromCharCode(o)}a=o===-2,r.push(c)}return r.join("")}function gS(e){const r={constructs:yv([hS,...(e||{}).extensions||[]]),content:a(PN),defined:[],document:a(IN),flow:a(Z9),lazy:{},string:a(eS),text:a(tS)};return r;function a(o){return c;function c(u){return pS(r,o,u)}}}function xS(e){for(;!wv(e););return e}const Kx=/[\0\t\n\r]/g;function yS(){let e=1,n="",s=!0,r;return a;function a(o,c,u){const d=[];let p,f,m,y,x;for(o=n+(typeof o=="string"?o.toString():new TextDecoder(c||void 0).decode(o)),m=0,n="",s&&(o.charCodeAt(0)===65279&&m++,s=void 0);m<o.length;){if(Kx.lastIndex=m,p=Kx.exec(o),y=p&&p.index!==void 0?p.index:o.length,x=o.charCodeAt(y),!p){n=o.slice(m);break}if(x===10&&m===y&&r)d.push(-3),r=void 0;else switch(r&&(d.push(-5),r=void 0),m<y&&(d.push(o.slice(m,y)),e+=y-m),x){case 0:{d.push(65533),e++;break}case 9:{for(f=Math.ceil(e/4)*4,d.push(-2);e++<f;)d.push(-1);break}case 10:{d.push(-4),e=1;break}default:r=!0,e=1}m=y+1}return u&&(r&&d.push(-5),n&&d.push(n),d.push(null)),d}}const kS=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function vS(e){return e.replace(kS,jS)}function jS(e,n,s){if(n)return n;if(s.charCodeAt(0)===35){const a=s.charCodeAt(1),o=a===120||a===88;return kv(s.slice(o?2:1),o?16:10)}return Wf(s)||e}const Tv={}.hasOwnProperty;function bS(e,n,s){return n&&typeof n=="object"&&(s=n,n=void 0),wS(s)(xS(gS(s).document().write(yS()(e,n,!0))))}function wS(e){const n={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(Vt),autolinkProtocol:B,autolinkEmail:B,atxHeading:o(Ht),blockQuote:o(De),characterEscape:B,characterReference:B,codeFenced:o(ct),codeFencedFenceInfo:c,codeFencedFenceMeta:c,codeIndented:o(ct,c),codeText:o(Ut,c),codeTextData:B,data:B,codeFlowValue:B,definition:o(on),definitionDestinationString:c,definitionLabelString:c,definitionTitleString:c,emphasis:o(Kn),hardBreakEscape:o(Mn),hardBreakTrailing:o(Mn),htmlFlow:o(bn,c),htmlFlowData:B,htmlText:o(bn,c),htmlTextData:B,image:o(ln),label:c,link:o(Vt),listItem:o(cn),listItemValue:y,listOrdered:o(xt,m),listUnordered:o(xt),paragraph:o(Yn),reference:z,referenceString:c,resourceDestinationString:c,resourceTitleString:c,setextHeading:o(Ht),strong:o(Ms),thematicBreak:o(He)},exit:{atxHeading:d(),atxHeadingSequence:M,autolink:d(),autolinkEmail:$e,autolinkProtocol:Ae,blockQuote:d(),characterEscapeValue:I,characterReferenceMarkerHexadecimal:he,characterReferenceMarkerNumeric:he,characterReferenceValue:ke,characterReference:Re,codeFenced:d(b),codeFencedFence:v,codeFencedFenceInfo:x,codeFencedFenceMeta:k,codeFlowValue:I,codeIndented:d(N),codeText:d(K),codeTextData:I,data:I,definition:d(),definitionDestinationString:P,definitionLabelString:C,definitionTitleString:S,emphasis:d(),hardBreakEscape:d(_),hardBreakTrailing:d(_),htmlFlow:d(Q),htmlFlowData:I,htmlText:d(q),htmlTextData:I,image:d(H),label:ne,labelText:V,lineEnding:O,link:d(ce),listItem:d(),listOrdered:d(),listUnordered:d(),paragraph:d(),referenceString:me,resourceDestinationString:A,resourceTitleString:D,resource:ee,setextHeading:d(R),setextHeadingLineSequence:F,setextHeadingText:T,strong:d(),thematicBreak:d()}};Av(n,(e||{}).mdastExtensions||[]);const s={};return r;function r(X){let le={type:"root",children:[]};const be={stack:[le],tokenStack:[],config:n,enter:u,exit:p,buffer:c,resume:f,data:s},Me=[];let J=-1;for(;++J<X.length;)if(X[J][1].type==="listOrdered"||X[J][1].type==="listUnordered")if(X[J][0]==="enter")Me.push(J);else{const Fe=Me.pop();J=a(X,Fe,J)}for(J=-1;++J<X.length;){const Fe=n[X[J][0]];Tv.call(Fe,X[J][1].type)&&Fe[X[J][1].type].call(Object.assign({sliceSerialize:X[J][2].sliceSerialize},be),X[J][1])}if(be.tokenStack.length>0){const Fe=be.tokenStack[be.tokenStack.length-1];(Fe[1]||Yx).call(be,void 0,Fe[0])}for(le.position={start:tr(X.length>0?X[0][1].start:{line:1,column:1,offset:0}),end:tr(X.length>0?X[X.length-2][1].end:{line:1,column:1,offset:0})},J=-1;++J<n.transforms.length;)le=n.transforms[J](le)||le;return le}function a(X,le,be){let Me=le-1,J=-1,Fe=!1,Nt,st,yt,pr;for(;++Me<=be;){const St=X[Me];switch(St[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{St[0]==="enter"?J++:J--,pr=void 0;break}case"lineEndingBlank":{St[0]==="enter"&&(Nt&&!pr&&!J&&!yt&&(yt=Me),pr=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:pr=void 0}if(!J&&St[0]==="enter"&&St[1].type==="listItemPrefix"||J===-1&&St[0]==="exit"&&(St[1].type==="listUnordered"||St[1].type==="listOrdered")){if(Nt){let Gn=Me;for(st=void 0;Gn--;){const un=X[Gn];if(un[1].type==="lineEnding"||un[1].type==="lineEndingBlank"){if(un[0]==="exit")continue;st&&(X[st][1].type="lineEndingBlank",Fe=!0),un[1].type="lineEnding",st=Gn}else if(!(un[1].type==="linePrefix"||un[1].type==="blockQuotePrefix"||un[1].type==="blockQuotePrefixWhitespace"||un[1].type==="blockQuoteMarker"||un[1].type==="listItemIndent"))break}yt&&(!st||yt<st)&&(Nt._spread=!0),Nt.end=Object.assign({},st?X[st][1].start:St[1].end),X.splice(st||Me,0,["exit",Nt,St[2]]),Me++,be++}if(St[1].type==="listItemPrefix"){const Gn={type:"listItem",_spread:!1,start:Object.assign({},St[1].start),end:void 0};Nt=Gn,X.splice(Me,0,["enter",Gn,St[2]]),Me++,be++,yt=void 0,pr=!0}}}return X[le][1]._spread=Fe,be}function o(X,le){return be;function be(Me){u.call(this,X(Me),Me),le&&le.call(this,Me)}}function c(){this.stack.push({type:"fragment",children:[]})}function u(X,le,be){this.stack[this.stack.length-1].children.push(X),this.stack.push(X),this.tokenStack.push([le,be||void 0]),X.position={start:tr(le.start),end:void 0}}function d(X){return le;function le(be){X&&X.call(this,be),p.call(this,be)}}function p(X,le){const be=this.stack.pop(),Me=this.tokenStack.pop();if(Me)Me[0].type!==X.type&&(le?le.call(this,X,Me[0]):(Me[1]||Yx).call(this,X,Me[0]));else throw new Error("Cannot close `"+X.type+"` ("+Ya({start:X.start,end:X.end})+"): it’s not open");be.position.end=tr(X.end)}function f(){return Bf(this.stack.pop())}function m(){this.data.expectingFirstListItemValue=!0}function y(X){if(this.data.expectingFirstListItemValue){const le=this.stack[this.stack.length-2];le.start=Number.parseInt(this.sliceSerialize(X),10),this.data.expectingFirstListItemValue=void 0}}function x(){const X=this.resume(),le=this.stack[this.stack.length-1];le.lang=X}function k(){const X=this.resume(),le=this.stack[this.stack.length-1];le.meta=X}function v(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function b(){const X=this.resume(),le=this.stack[this.stack.length-1];le.value=X.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function N(){const X=this.resume(),le=this.stack[this.stack.length-1];le.value=X.replace(/(\r?\n|\r)$/g,"")}function C(X){const le=this.resume(),be=this.stack[this.stack.length-1];be.label=le,be.identifier=Hn(this.sliceSerialize(X)).toLowerCase()}function S(){const X=this.resume(),le=this.stack[this.stack.length-1];le.title=X}function P(){const X=this.resume(),le=this.stack[this.stack.length-1];le.url=X}function M(X){const le=this.stack[this.stack.length-1];if(!le.depth){const be=this.sliceSerialize(X).length;le.depth=be}}function T(){this.data.setextHeadingSlurpLineEnding=!0}function F(X){const le=this.stack[this.stack.length-1];le.depth=this.sliceSerialize(X).codePointAt(0)===61?1:2}function R(){this.data.setextHeadingSlurpLineEnding=void 0}function B(X){const be=this.stack[this.stack.length-1].children;let Me=be[be.length-1];(!Me||Me.type!=="text")&&(Me=Qn(),Me.position={start:tr(X.start),end:void 0},be.push(Me)),this.stack.push(Me)}function I(X){const le=this.stack.pop();le.value+=this.sliceSerialize(X),le.position.end=tr(X.end)}function O(X){const le=this.stack[this.stack.length-1];if(this.data.atHardBreak){const be=le.children[le.children.length-1];be.position.end=tr(X.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&n.canContainEols.includes(le.type)&&(B.call(this,X),I.call(this,X))}function _(){this.data.atHardBreak=!0}function Q(){const X=this.resume(),le=this.stack[this.stack.length-1];le.value=X}function q(){const X=this.resume(),le=this.stack[this.stack.length-1];le.value=X}function K(){const X=this.resume(),le=this.stack[this.stack.length-1];le.value=X}function ce(){const X=this.stack[this.stack.length-1];if(this.data.inReference){const le=this.data.referenceType||"shortcut";X.type+="Reference",X.referenceType=le,delete X.url,delete X.title}else delete X.identifier,delete X.label;this.data.referenceType=void 0}function H(){const X=this.stack[this.stack.length-1];if(this.data.inReference){const le=this.data.referenceType||"shortcut";X.type+="Reference",X.referenceType=le,delete X.url,delete X.title}else delete X.identifier,delete X.label;this.data.referenceType=void 0}function V(X){const le=this.sliceSerialize(X),be=this.stack[this.stack.length-2];be.label=vS(le),be.identifier=Hn(le).toLowerCase()}function ne(){const X=this.stack[this.stack.length-1],le=this.resume(),be=this.stack[this.stack.length-1];if(this.data.inReference=!0,be.type==="link"){const Me=X.children;be.children=Me}else be.alt=le}function A(){const X=this.resume(),le=this.stack[this.stack.length-1];le.url=X}function D(){const X=this.resume(),le=this.stack[this.stack.length-1];le.title=X}function ee(){this.data.inReference=void 0}function z(){this.data.referenceType="collapsed"}function me(X){const le=this.resume(),be=this.stack[this.stack.length-1];be.label=le,be.identifier=Hn(this.sliceSerialize(X)).toLowerCase(),this.data.referenceType="full"}function he(X){this.data.characterReferenceType=X.type}function ke(X){const le=this.sliceSerialize(X),be=this.data.characterReferenceType;let Me;be?(Me=kv(le,be==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Me=Wf(le);const J=this.stack[this.stack.length-1];J.value+=Me}function Re(X){const le=this.stack.pop();le.position.end=tr(X.end)}function Ae(X){I.call(this,X);const le=this.stack[this.stack.length-1];le.url=this.sliceSerialize(X)}function $e(X){I.call(this,X);const le=this.stack[this.stack.length-1];le.url="mailto:"+this.sliceSerialize(X)}function De(){return{type:"blockquote",children:[]}}function ct(){return{type:"code",lang:null,meta:null,value:""}}function Ut(){return{type:"inlineCode",value:""}}function on(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Kn(){return{type:"emphasis",children:[]}}function Ht(){return{type:"heading",depth:0,children:[]}}function Mn(){return{type:"break"}}function bn(){return{type:"html",value:""}}function ln(){return{type:"image",title:null,url:"",alt:null}}function Vt(){return{type:"link",title:null,url:"",children:[]}}function xt(X){return{type:"list",ordered:X.type==="listOrdered",start:null,spread:X._spread,children:[]}}function cn(X){return{type:"listItem",spread:X._spread,checked:null,children:[]}}function Yn(){return{type:"paragraph",children:[]}}function Ms(){return{type:"strong",children:[]}}function Qn(){return{type:"text",value:""}}function He(){return{type:"thematicBreak"}}}function tr(e){return{line:e.line,column:e.column,offset:e.offset}}function Av(e,n){let s=-1;for(;++s<n.length;){const r=n[s];Array.isArray(r)?Av(e,r):NS(e,r)}}function NS(e,n){let s;for(s in n)if(Tv.call(n,s))switch(s){case"canContainEols":{const r=n[s];r&&e[s].push(...r);break}case"transforms":{const r=n[s];r&&e[s].push(...r);break}case"enter":case"exit":{const r=n[s];r&&Object.assign(e[s],r);break}}}function Yx(e,n){throw e?new Error("Cannot close `"+e.type+"` ("+Ya({start:e.start,end:e.end})+"): a different token (`"+n.type+"`, "+Ya({start:n.start,end:n.end})+") is open"):new Error("Cannot close document, a token (`"+n.type+"`, "+Ya({start:n.start,end:n.end})+") is still open")}function SS(e){const n=this;n.parser=s;function s(r){return bS(r,{...n.data("settings"),...e,extensions:n.data("micromarkExtensions")||[],mdastExtensions:n.data("fromMarkdownExtensions")||[]})}}function CS(e,n){const s={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(n),!0)};return e.patch(n,s),e.applyData(n,s)}function $S(e,n){const s={type:"element",tagName:"br",properties:{},children:[]};return e.patch(n,s),[e.applyData(n,s),{type:"text",value:`
566
- `}]}function ES(e,n){const s=n.value?n.value+`
567
- `:"",r={},a=n.lang?n.lang.split(/\s+/):[];a.length>0&&(r.className=["language-"+a[0]]);let o={type:"element",tagName:"code",properties:r,children:[{type:"text",value:s}]};return n.meta&&(o.data={meta:n.meta}),e.patch(n,o),o=e.applyData(n,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(n,o),o}function TS(e,n){const s={type:"element",tagName:"del",properties:{},children:e.all(n)};return e.patch(n,s),e.applyData(n,s)}function AS(e,n){const s={type:"element",tagName:"em",properties:{},children:e.all(n)};return e.patch(n,s),e.applyData(n,s)}function PS(e,n){const s=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(n.identifier).toUpperCase(),a=Qi(r.toLowerCase()),o=e.footnoteOrder.indexOf(r);let c,u=e.footnoteCounts.get(r);u===void 0?(u=0,e.footnoteOrder.push(r),c=e.footnoteOrder.length):c=o+1,u+=1,e.footnoteCounts.set(r,u);const d={type:"element",tagName:"a",properties:{href:"#"+s+"fn-"+a,id:s+"fnref-"+a+(u>1?"-"+u:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(c)}]};e.patch(n,d);const p={type:"element",tagName:"sup",properties:{},children:[d]};return e.patch(n,p),e.applyData(n,p)}function RS(e,n){const s={type:"element",tagName:"h"+n.depth,properties:{},children:e.all(n)};return e.patch(n,s),e.applyData(n,s)}function IS(e,n){if(e.options.allowDangerousHtml){const s={type:"raw",value:n.value};return e.patch(n,s),e.applyData(n,s)}}function Pv(e,n){const s=n.referenceType;let r="]";if(s==="collapsed"?r+="[]":s==="full"&&(r+="["+(n.label||n.identifier)+"]"),n.type==="imageReference")return[{type:"text",value:"!["+n.alt+r}];const a=e.all(n),o=a[0];o&&o.type==="text"?o.value="["+o.value:a.unshift({type:"text",value:"["});const c=a[a.length-1];return c&&c.type==="text"?c.value+=r:a.push({type:"text",value:r}),a}function zS(e,n){const s=String(n.identifier).toUpperCase(),r=e.definitionById.get(s);if(!r)return Pv(e,n);const a={src:Qi(r.url||""),alt:n.alt};r.title!==null&&r.title!==void 0&&(a.title=r.title);const o={type:"element",tagName:"img",properties:a,children:[]};return e.patch(n,o),e.applyData(n,o)}function MS(e,n){const s={src:Qi(n.url)};n.alt!==null&&n.alt!==void 0&&(s.alt=n.alt),n.title!==null&&n.title!==void 0&&(s.title=n.title);const r={type:"element",tagName:"img",properties:s,children:[]};return e.patch(n,r),e.applyData(n,r)}function FS(e,n){const s={type:"text",value:n.value.replace(/\r?\n|\r/g," ")};e.patch(n,s);const r={type:"element",tagName:"code",properties:{},children:[s]};return e.patch(n,r),e.applyData(n,r)}function LS(e,n){const s=String(n.identifier).toUpperCase(),r=e.definitionById.get(s);if(!r)return Pv(e,n);const a={href:Qi(r.url||"")};r.title!==null&&r.title!==void 0&&(a.title=r.title);const o={type:"element",tagName:"a",properties:a,children:e.all(n)};return e.patch(n,o),e.applyData(n,o)}function _S(e,n){const s={href:Qi(n.url)};n.title!==null&&n.title!==void 0&&(s.title=n.title);const r={type:"element",tagName:"a",properties:s,children:e.all(n)};return e.patch(n,r),e.applyData(n,r)}function OS(e,n,s){const r=e.all(n),a=s?qS(s):Rv(n),o={},c=[];if(typeof n.checked=="boolean"){const f=r[0];let m;f&&f.type==="element"&&f.tagName==="p"?m=f:(m={type:"element",tagName:"p",properties:{},children:[]},r.unshift(m)),m.children.length>0&&m.children.unshift({type:"text",value:" "}),m.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:n.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let u=-1;for(;++u<r.length;){const f=r[u];(a||u!==0||f.type!=="element"||f.tagName!=="p")&&c.push({type:"text",value:`
568
- `}),f.type==="element"&&f.tagName==="p"&&!a?c.push(...f.children):c.push(f)}const d=r[r.length-1];d&&(a||d.type!=="element"||d.tagName!=="p")&&c.push({type:"text",value:`
569
- `});const p={type:"element",tagName:"li",properties:o,children:c};return e.patch(n,p),e.applyData(n,p)}function qS(e){let n=!1;if(e.type==="list"){n=e.spread||!1;const s=e.children;let r=-1;for(;!n&&++r<s.length;)n=Rv(s[r])}return n}function Rv(e){const n=e.spread;return n??e.children.length>1}function DS(e,n){const s={},r=e.all(n);let a=-1;for(typeof n.start=="number"&&n.start!==1&&(s.start=n.start);++a<r.length;){const c=r[a];if(c.type==="element"&&c.tagName==="li"&&c.properties&&Array.isArray(c.properties.className)&&c.properties.className.includes("task-list-item")){s.className=["contains-task-list"];break}}const o={type:"element",tagName:n.ordered?"ol":"ul",properties:s,children:e.wrap(r,!0)};return e.patch(n,o),e.applyData(n,o)}function BS(e,n){const s={type:"element",tagName:"p",properties:{},children:e.all(n)};return e.patch(n,s),e.applyData(n,s)}function WS(e,n){const s={type:"root",children:e.wrap(e.all(n))};return e.patch(n,s),e.applyData(n,s)}function US(e,n){const s={type:"element",tagName:"strong",properties:{},children:e.all(n)};return e.patch(n,s),e.applyData(n,s)}function HS(e,n){const s=e.all(n),r=s.shift(),a=[];if(r){const c={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(n.children[0],c),a.push(c)}if(s.length>0){const c={type:"element",tagName:"tbody",properties:{},children:e.wrap(s,!0)},u=_f(n.children[1]),d=dv(n.children[n.children.length-1]);u&&d&&(c.position={start:u,end:d}),a.push(c)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(a,!0)};return e.patch(n,o),e.applyData(n,o)}function VS(e,n,s){const r=s?s.children:void 0,o=(r?r.indexOf(n):1)===0?"th":"td",c=s&&s.type==="table"?s.align:void 0,u=c?c.length:n.children.length;let d=-1;const p=[];for(;++d<u;){const m=n.children[d],y={},x=c?c[d]:void 0;x&&(y.align=x);let k={type:"element",tagName:o,properties:y,children:[]};m&&(k.children=e.all(m),e.patch(m,k),k=e.applyData(m,k)),p.push(k)}const f={type:"element",tagName:"tr",properties:{},children:e.wrap(p,!0)};return e.patch(n,f),e.applyData(n,f)}function KS(e,n){const s={type:"element",tagName:"td",properties:{},children:e.all(n)};return e.patch(n,s),e.applyData(n,s)}const Qx=9,Gx=32;function YS(e){const n=String(e),s=/\r?\n|\r/g;let r=s.exec(n),a=0;const o=[];for(;r;)o.push(Zx(n.slice(a,r.index),a>0,!0),r[0]),a=r.index+r[0].length,r=s.exec(n);return o.push(Zx(n.slice(a),a>0,!1)),o.join("")}function Zx(e,n,s){let r=0,a=e.length;if(n){let o=e.codePointAt(r);for(;o===Qx||o===Gx;)r++,o=e.codePointAt(r)}if(s){let o=e.codePointAt(a-1);for(;o===Qx||o===Gx;)a--,o=e.codePointAt(a-1)}return a>r?e.slice(r,a):""}function QS(e,n){const s={type:"text",value:YS(String(n.value))};return e.patch(n,s),e.applyData(n,s)}function GS(e,n){const s={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(n,s),e.applyData(n,s)}const ZS={blockquote:CS,break:$S,code:ES,delete:TS,emphasis:AS,footnoteReference:PS,heading:RS,html:IS,imageReference:zS,image:MS,inlineCode:FS,linkReference:LS,link:_S,listItem:OS,list:DS,paragraph:BS,root:WS,strong:US,table:HS,tableCell:KS,tableRow:VS,text:QS,thematicBreak:GS,toml:rc,yaml:rc,definition:rc,footnoteDefinition:rc};function rc(){}const Iv=-1,xu=0,Ga=1,Wc=2,Hf=3,Vf=4,Kf=5,Yf=6,zv=7,Mv=8,Xx=typeof self=="object"?self:globalThis,XS=(e,n)=>{const s=(a,o)=>(e.set(o,a),a),r=a=>{if(e.has(a))return e.get(a);const[o,c]=n[a];switch(o){case xu:case Iv:return s(c,a);case Ga:{const u=s([],a);for(const d of c)u.push(r(d));return u}case Wc:{const u=s({},a);for(const[d,p]of c)u[r(d)]=r(p);return u}case Hf:return s(new Date(c),a);case Vf:{const{source:u,flags:d}=c;return s(new RegExp(u,d),a)}case Kf:{const u=s(new Map,a);for(const[d,p]of c)u.set(r(d),r(p));return u}case Yf:{const u=s(new Set,a);for(const d of c)u.add(r(d));return u}case zv:{const{name:u,message:d}=c;return s(new Xx[u](d),a)}case Mv:return s(BigInt(c),a);case"BigInt":return s(Object(BigInt(c)),a);case"ArrayBuffer":return s(new Uint8Array(c).buffer,c);case"DataView":{const{buffer:u}=new Uint8Array(c);return s(new DataView(u),c)}}return s(new Xx[o](c),a)};return r},Jx=e=>XS(new Map,e)(0),Si="",{toString:JS}={},{keys:eC}=Object,Wa=e=>{const n=typeof e;if(n!=="object"||!e)return[xu,n];const s=JS.call(e).slice(8,-1);switch(s){case"Array":return[Ga,Si];case"Object":return[Wc,Si];case"Date":return[Hf,Si];case"RegExp":return[Vf,Si];case"Map":return[Kf,Si];case"Set":return[Yf,Si];case"DataView":return[Ga,s]}return s.includes("Array")?[Ga,s]:s.includes("Error")?[zv,s]:[Wc,s]},ic=([e,n])=>e===xu&&(n==="function"||n==="symbol"),tC=(e,n,s,r)=>{const a=(c,u)=>{const d=r.push(c)-1;return s.set(u,d),d},o=c=>{if(s.has(c))return s.get(c);let[u,d]=Wa(c);switch(u){case xu:{let f=c;switch(d){case"bigint":u=Mv,f=c.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+d);f=null;break;case"undefined":return a([Iv],c)}return a([u,f],c)}case Ga:{if(d){let y=c;return d==="DataView"?y=new Uint8Array(c.buffer):d==="ArrayBuffer"&&(y=new Uint8Array(c)),a([d,[...y]],c)}const f=[],m=a([u,f],c);for(const y of c)f.push(o(y));return m}case Wc:{if(d)switch(d){case"BigInt":return a([d,c.toString()],c);case"Boolean":case"Number":case"String":return a([d,c.valueOf()],c)}if(n&&"toJSON"in c)return o(c.toJSON());const f=[],m=a([u,f],c);for(const y of eC(c))(e||!ic(Wa(c[y])))&&f.push([o(y),o(c[y])]);return m}case Hf:return a([u,c.toISOString()],c);case Vf:{const{source:f,flags:m}=c;return a([u,{source:f,flags:m}],c)}case Kf:{const f=[],m=a([u,f],c);for(const[y,x]of c)(e||!(ic(Wa(y))||ic(Wa(x))))&&f.push([o(y),o(x)]);return m}case Yf:{const f=[],m=a([u,f],c);for(const y of c)(e||!ic(Wa(y)))&&f.push(o(y));return m}}const{message:p}=c;return a([u,{name:d,message:p}],c)};return o},ey=(e,{json:n,lossy:s}={})=>{const r=[];return tC(!(n||s),!!n,new Map,r)(e),r},Uc=typeof structuredClone=="function"?(e,n)=>n&&("json"in n||"lossy"in n)?Jx(ey(e,n)):structuredClone(e):(e,n)=>Jx(ey(e,n));function nC(e,n){const s=[{type:"text",value:"↩"}];return n>1&&s.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(n)}]}),s}function sC(e,n){return"Back to reference "+(e+1)+(n>1?"-"+n:"")}function rC(e){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",s=e.options.footnoteBackContent||nC,r=e.options.footnoteBackLabel||sC,a=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",c=e.options.footnoteLabelProperties||{className:["sr-only"]},u=[];let d=-1;for(;++d<e.footnoteOrder.length;){const p=e.footnoteById.get(e.footnoteOrder[d]);if(!p)continue;const f=e.all(p),m=String(p.identifier).toUpperCase(),y=Qi(m.toLowerCase());let x=0;const k=[],v=e.footnoteCounts.get(m);for(;v!==void 0&&++x<=v;){k.length>0&&k.push({type:"text",value:" "});let C=typeof s=="string"?s:s(d,x);typeof C=="string"&&(C={type:"text",value:C}),k.push({type:"element",tagName:"a",properties:{href:"#"+n+"fnref-"+y+(x>1?"-"+x:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(d,x),className:["data-footnote-backref"]},children:Array.isArray(C)?C:[C]})}const b=f[f.length-1];if(b&&b.type==="element"&&b.tagName==="p"){const C=b.children[b.children.length-1];C&&C.type==="text"?C.value+=" ":b.children.push({type:"text",value:" "}),b.children.push(...k)}else f.push(...k);const N={type:"element",tagName:"li",properties:{id:n+"fn-"+y},children:e.wrap(f,!0)};e.patch(p,N),u.push(N)}if(u.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...Uc(c),id:"footnote-label"},children:[{type:"text",value:a}]},{type:"text",value:`
570
- `},{type:"element",tagName:"ol",properties:{},children:e.wrap(u,!0)},{type:"text",value:`
571
- `}]}}const Oo=(function(e){if(e==null)return lC;if(typeof e=="function")return yu(e);if(typeof e=="object")return Array.isArray(e)?iC(e):aC(e);if(typeof e=="string")return oC(e);throw new Error("Expected function, string, or object as test")});function iC(e){const n=[];let s=-1;for(;++s<e.length;)n[s]=Oo(e[s]);return yu(r);function r(...a){let o=-1;for(;++o<n.length;)if(n[o].apply(this,a))return!0;return!1}}function aC(e){const n=e;return yu(s);function s(r){const a=r;let o;for(o in e)if(a[o]!==n[o])return!1;return!0}}function oC(e){return yu(n);function n(s){return s&&s.type===e}}function yu(e){return n;function n(s,r,a){return!!(cC(s)&&e.call(this,s,typeof r=="number"?r:void 0,a||void 0))}}function lC(){return!0}function cC(e){return e!==null&&typeof e=="object"&&"type"in e}const Fv=[],uC=!0,Vp=!1,dC="skip";function hC(e,n,s,r){let a;typeof n=="function"&&typeof s!="function"?(r=s,s=n):a=n;const o=Oo(a),c=r?-1:1;u(e,void 0,[])();function u(d,p,f){const m=d&&typeof d=="object"?d:{};if(typeof m.type=="string"){const x=typeof m.tagName=="string"?m.tagName:typeof m.name=="string"?m.name:void 0;Object.defineProperty(y,"name",{value:"node ("+(d.type+(x?"<"+x+">":""))+")"})}return y;function y(){let x=Fv,k,v,b;if((!n||o(d,p,f[f.length-1]||void 0))&&(x=pC(s(d,f)),x[0]===Vp))return x;if("children"in d&&d.children){const N=d;if(N.children&&x[0]!==dC)for(v=(r?N.children.length:-1)+c,b=f.concat(N);v>-1&&v<N.children.length;){const C=N.children[v];if(k=u(C,v,b)(),k[0]===Vp)return k;v=typeof k[1]=="number"?k[1]:v+c}}return x}}}function pC(e){return Array.isArray(e)?e:typeof e=="number"?[uC,e]:e==null?Fv:[e]}function Qf(e,n,s,r){let a,o,c;typeof n=="function"&&typeof s!="function"?(o=void 0,c=n,a=s):(o=n,c=s,a=r),hC(e,o,u,a);function u(d,p){const f=p[p.length-1],m=f?f.children.indexOf(d):void 0;return c(d,m,f)}}const Kp={}.hasOwnProperty,fC={};function mC(e,n){const s=n||fC,r=new Map,a=new Map,o=new Map,c={...ZS,...s.handlers},u={all:p,applyData:xC,definitionById:r,footnoteById:a,footnoteCounts:o,footnoteOrder:[],handlers:c,one:d,options:s,patch:gC,wrap:kC};return Qf(e,function(f){if(f.type==="definition"||f.type==="footnoteDefinition"){const m=f.type==="definition"?r:a,y=String(f.identifier).toUpperCase();m.has(y)||m.set(y,f)}}),u;function d(f,m){const y=f.type,x=u.handlers[y];if(Kp.call(u.handlers,y)&&x)return x(u,f,m);if(u.options.passThrough&&u.options.passThrough.includes(y)){if("children"in f){const{children:v,...b}=f,N=Uc(b);return N.children=u.all(f),N}return Uc(f)}return(u.options.unknownHandler||yC)(u,f,m)}function p(f){const m=[];if("children"in f){const y=f.children;let x=-1;for(;++x<y.length;){const k=u.one(y[x],f);if(k){if(x&&y[x-1].type==="break"&&(!Array.isArray(k)&&k.type==="text"&&(k.value=ty(k.value)),!Array.isArray(k)&&k.type==="element")){const v=k.children[0];v&&v.type==="text"&&(v.value=ty(v.value))}Array.isArray(k)?m.push(...k):m.push(k)}}}return m}}function gC(e,n){e.position&&(n.position=sN(e))}function xC(e,n){let s=n;if(e&&e.data){const r=e.data.hName,a=e.data.hChildren,o=e.data.hProperties;if(typeof r=="string")if(s.type==="element")s.tagName=r;else{const c="children"in s?s.children:[s];s={type:"element",tagName:r,properties:{},children:c}}s.type==="element"&&o&&Object.assign(s.properties,Uc(o)),"children"in s&&s.children&&a!==null&&a!==void 0&&(s.children=a)}return s}function yC(e,n){const s=n.data||{},r="value"in n&&!(Kp.call(s,"hProperties")||Kp.call(s,"hChildren"))?{type:"text",value:n.value}:{type:"element",tagName:"div",properties:{},children:e.all(n)};return e.patch(n,r),e.applyData(n,r)}function kC(e,n){const s=[];let r=-1;for(n&&s.push({type:"text",value:`
572
- `});++r<e.length;)r&&s.push({type:"text",value:`
573
- `}),s.push(e[r]);return n&&e.length>0&&s.push({type:"text",value:`
574
- `}),s}function ty(e){let n=0,s=e.charCodeAt(n);for(;s===9||s===32;)n++,s=e.charCodeAt(n);return e.slice(n)}function ny(e,n){const s=mC(e,n),r=s.one(e,void 0),a=rC(s),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return a&&o.children.push({type:"text",value:`
575
- `},a),o}function vC(e,n){return e&&"run"in e?async function(s,r){const a=ny(s,{file:r,...n});await e.run(a,r)}:function(s,r){return ny(s,{file:r,...e||n})}}function sy(e){if(e)throw e}var Wh,ry;function jC(){if(ry)return Wh;ry=1;var e=Object.prototype.hasOwnProperty,n=Object.prototype.toString,s=Object.defineProperty,r=Object.getOwnPropertyDescriptor,a=function(p){return typeof Array.isArray=="function"?Array.isArray(p):n.call(p)==="[object Array]"},o=function(p){if(!p||n.call(p)!=="[object Object]")return!1;var f=e.call(p,"constructor"),m=p.constructor&&p.constructor.prototype&&e.call(p.constructor.prototype,"isPrototypeOf");if(p.constructor&&!f&&!m)return!1;var y;for(y in p);return typeof y>"u"||e.call(p,y)},c=function(p,f){s&&f.name==="__proto__"?s(p,f.name,{enumerable:!0,configurable:!0,value:f.newValue,writable:!0}):p[f.name]=f.newValue},u=function(p,f){if(f==="__proto__")if(e.call(p,f)){if(r)return r(p,f).value}else return;return p[f]};return Wh=function d(){var p,f,m,y,x,k,v=arguments[0],b=1,N=arguments.length,C=!1;for(typeof v=="boolean"&&(C=v,v=arguments[1]||{},b=2),(v==null||typeof v!="object"&&typeof v!="function")&&(v={});b<N;++b)if(p=arguments[b],p!=null)for(f in p)m=u(v,f),y=u(p,f),v!==y&&(C&&y&&(o(y)||(x=a(y)))?(x?(x=!1,k=m&&a(m)?m:[]):k=m&&o(m)?m:{},c(v,{name:f,newValue:d(C,k,y)})):typeof y<"u"&&c(v,{name:f,newValue:y}));return v},Wh}var bC=jC();const Uh=hf(bC);function Yp(e){if(typeof e!="object"||e===null)return!1;const n=Object.getPrototypeOf(e);return(n===null||n===Object.prototype||Object.getPrototypeOf(n)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function wC(){const e=[],n={run:s,use:r};return n;function s(...a){let o=-1;const c=a.pop();if(typeof c!="function")throw new TypeError("Expected function as last argument, not "+c);u(null,...a);function u(d,...p){const f=e[++o];let m=-1;if(d){c(d);return}for(;++m<a.length;)(p[m]===null||p[m]===void 0)&&(p[m]=a[m]);a=p,f?NC(f,u)(...p):c(null,...p)}}function r(a){if(typeof a!="function")throw new TypeError("Expected `middelware` to be a function, not "+a);return e.push(a),n}}function NC(e,n){let s;return r;function r(...c){const u=e.length>c.length;let d;u&&c.push(a);try{d=e.apply(this,c)}catch(p){const f=p;if(u&&s)throw f;return a(f)}u||(d&&d.then&&typeof d.then=="function"?d.then(o,a):d instanceof Error?a(d):o(d))}function a(c,...u){s||(s=!0,n(c,...u))}function o(c){a(null,c)}}const ns={basename:SC,dirname:CC,extname:$C,join:EC,sep:"/"};function SC(e,n){if(n!==void 0&&typeof n!="string")throw new TypeError('"ext" argument must be a string');qo(e);let s=0,r=-1,a=e.length,o;if(n===void 0||n.length===0||n.length>e.length){for(;a--;)if(e.codePointAt(a)===47){if(o){s=a+1;break}}else r<0&&(o=!0,r=a+1);return r<0?"":e.slice(s,r)}if(n===e)return"";let c=-1,u=n.length-1;for(;a--;)if(e.codePointAt(a)===47){if(o){s=a+1;break}}else c<0&&(o=!0,c=a+1),u>-1&&(e.codePointAt(a)===n.codePointAt(u--)?u<0&&(r=a):(u=-1,r=c));return s===r?r=c:r<0&&(r=e.length),e.slice(s,r)}function CC(e){if(qo(e),e.length===0)return".";let n=-1,s=e.length,r;for(;--s;)if(e.codePointAt(s)===47){if(r){n=s;break}}else r||(r=!0);return n<0?e.codePointAt(0)===47?"/":".":n===1&&e.codePointAt(0)===47?"//":e.slice(0,n)}function $C(e){qo(e);let n=e.length,s=-1,r=0,a=-1,o=0,c;for(;n--;){const u=e.codePointAt(n);if(u===47){if(c){r=n+1;break}continue}s<0&&(c=!0,s=n+1),u===46?a<0?a=n:o!==1&&(o=1):a>-1&&(o=-1)}return a<0||s<0||o===0||o===1&&a===s-1&&a===r+1?"":e.slice(a,s)}function EC(...e){let n=-1,s;for(;++n<e.length;)qo(e[n]),e[n]&&(s=s===void 0?e[n]:s+"/"+e[n]);return s===void 0?".":TC(s)}function TC(e){qo(e);const n=e.codePointAt(0)===47;let s=AC(e,!n);return s.length===0&&!n&&(s="."),s.length>0&&e.codePointAt(e.length-1)===47&&(s+="/"),n?"/"+s:s}function AC(e,n){let s="",r=0,a=-1,o=0,c=-1,u,d;for(;++c<=e.length;){if(c<e.length)u=e.codePointAt(c);else{if(u===47)break;u=47}if(u===47){if(!(a===c-1||o===1))if(a!==c-1&&o===2){if(s.length<2||r!==2||s.codePointAt(s.length-1)!==46||s.codePointAt(s.length-2)!==46){if(s.length>2){if(d=s.lastIndexOf("/"),d!==s.length-1){d<0?(s="",r=0):(s=s.slice(0,d),r=s.length-1-s.lastIndexOf("/")),a=c,o=0;continue}}else if(s.length>0){s="",r=0,a=c,o=0;continue}}n&&(s=s.length>0?s+"/..":"..",r=2)}else s.length>0?s+="/"+e.slice(a+1,c):s=e.slice(a+1,c),r=c-a-1;a=c,o=0}else u===46&&o>-1?o++:o=-1}return s}function qo(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const PC={cwd:RC};function RC(){return"/"}function Qp(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function IC(e){if(typeof e=="string")e=new URL(e);else if(!Qp(e)){const n=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw n.code="ERR_INVALID_ARG_TYPE",n}if(e.protocol!=="file:"){const n=new TypeError("The URL must be of scheme file");throw n.code="ERR_INVALID_URL_SCHEME",n}return zC(e)}function zC(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const n=e.pathname;let s=-1;for(;++s<n.length;)if(n.codePointAt(s)===37&&n.codePointAt(s+1)===50){const r=n.codePointAt(s+2);if(r===70||r===102){const a=new TypeError("File URL path must not include encoded / characters");throw a.code="ERR_INVALID_FILE_URL_PATH",a}}return decodeURIComponent(n)}const Hh=["history","path","basename","stem","extname","dirname"];class Lv{constructor(n){let s;n?Qp(n)?s={path:n}:typeof n=="string"||MC(n)?s={value:n}:s=n:s={},this.cwd="cwd"in s?"":PC.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Hh.length;){const o=Hh[r];o in s&&s[o]!==void 0&&s[o]!==null&&(this[o]=o==="history"?[...s[o]]:s[o])}let a;for(a in s)Hh.includes(a)||(this[a]=s[a])}get basename(){return typeof this.path=="string"?ns.basename(this.path):void 0}set basename(n){Kh(n,"basename"),Vh(n,"basename"),this.path=ns.join(this.dirname||"",n)}get dirname(){return typeof this.path=="string"?ns.dirname(this.path):void 0}set dirname(n){iy(this.basename,"dirname"),this.path=ns.join(n||"",this.basename)}get extname(){return typeof this.path=="string"?ns.extname(this.path):void 0}set extname(n){if(Vh(n,"extname"),iy(this.dirname,"extname"),n){if(n.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(n.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=ns.join(this.dirname,this.stem+(n||""))}get path(){return this.history[this.history.length-1]}set path(n){Qp(n)&&(n=IC(n)),Kh(n,"path"),this.path!==n&&this.history.push(n)}get stem(){return typeof this.path=="string"?ns.basename(this.path,this.extname):void 0}set stem(n){Kh(n,"stem"),Vh(n,"stem"),this.path=ns.join(this.dirname||"",n+(this.extname||""))}fail(n,s,r){const a=this.message(n,s,r);throw a.fatal=!0,a}info(n,s,r){const a=this.message(n,s,r);return a.fatal=void 0,a}message(n,s,r){const a=new qt(n,s,r);return this.path&&(a.name=this.path+":"+a.name,a.file=this.path),a.fatal=!1,this.messages.push(a),a}toString(n){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(n||void 0).decode(this.value)}}function Vh(e,n){if(e&&e.includes(ns.sep))throw new Error("`"+n+"` cannot be a path: did not expect `"+ns.sep+"`")}function Kh(e,n){if(!e)throw new Error("`"+n+"` cannot be empty")}function iy(e,n){if(!e)throw new Error("Setting `"+n+"` requires `path` to be set too")}function MC(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const FC=(function(e){const r=this.constructor.prototype,a=r[e],o=function(){return a.apply(o,arguments)};return Object.setPrototypeOf(o,r),o}),LC={}.hasOwnProperty;class Gf extends FC{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=wC()}copy(){const n=new Gf;let s=-1;for(;++s<this.attachers.length;){const r=this.attachers[s];n.use(...r)}return n.data(Uh(!0,{},this.namespace)),n}data(n,s){return typeof n=="string"?arguments.length===2?(Gh("data",this.frozen),this.namespace[n]=s,this):LC.call(this.namespace,n)&&this.namespace[n]||void 0:n?(Gh("data",this.frozen),this.namespace=n,this):this.namespace}freeze(){if(this.frozen)return this;const n=this;for(;++this.freezeIndex<this.attachers.length;){const[s,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const a=s.call(n,...r);typeof a=="function"&&this.transformers.use(a)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(n){this.freeze();const s=ac(n),r=this.parser||this.Parser;return Yh("parse",r),r(String(s),s)}process(n,s){const r=this;return this.freeze(),Yh("process",this.parser||this.Parser),Qh("process",this.compiler||this.Compiler),s?a(void 0,s):new Promise(a);function a(o,c){const u=ac(n),d=r.parse(u);r.run(d,u,function(f,m,y){if(f||!m||!y)return p(f);const x=m,k=r.stringify(x,y);qC(k)?y.value=k:y.result=k,p(f,y)});function p(f,m){f||!m?c(f):o?o(m):s(void 0,m)}}}processSync(n){let s=!1,r;return this.freeze(),Yh("processSync",this.parser||this.Parser),Qh("processSync",this.compiler||this.Compiler),this.process(n,a),oy("processSync","process",s),r;function a(o,c){s=!0,sy(o),r=c}}run(n,s,r){ay(n),this.freeze();const a=this.transformers;return!r&&typeof s=="function"&&(r=s,s=void 0),r?o(void 0,r):new Promise(o);function o(c,u){const d=ac(s);a.run(n,d,p);function p(f,m,y){const x=m||n;f?u(f):c?c(x):r(void 0,x,y)}}}runSync(n,s){let r=!1,a;return this.run(n,s,o),oy("runSync","run",r),a;function o(c,u){sy(c),a=u,r=!0}}stringify(n,s){this.freeze();const r=ac(s),a=this.compiler||this.Compiler;return Qh("stringify",a),ay(n),a(n,r)}use(n,...s){const r=this.attachers,a=this.namespace;if(Gh("use",this.frozen),n!=null)if(typeof n=="function")d(n,s);else if(typeof n=="object")Array.isArray(n)?u(n):c(n);else throw new TypeError("Expected usable value, not `"+n+"`");return this;function o(p){if(typeof p=="function")d(p,[]);else if(typeof p=="object")if(Array.isArray(p)){const[f,...m]=p;d(f,m)}else c(p);else throw new TypeError("Expected usable value, not `"+p+"`")}function c(p){if(!("plugins"in p)&&!("settings"in p))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");u(p.plugins),p.settings&&(a.settings=Uh(!0,a.settings,p.settings))}function u(p){let f=-1;if(p!=null)if(Array.isArray(p))for(;++f<p.length;){const m=p[f];o(m)}else throw new TypeError("Expected a list of plugins, not `"+p+"`")}function d(p,f){let m=-1,y=-1;for(;++m<r.length;)if(r[m][0]===p){y=m;break}if(y===-1)r.push([p,...f]);else if(f.length>0){let[x,...k]=f;const v=r[y][1];Yp(v)&&Yp(x)&&(x=Uh(!0,v,x)),r[y]=[p,x,...k]}}}}const _C=new Gf().freeze();function Yh(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Qh(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Gh(e,n){if(n)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function ay(e){if(!Yp(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function oy(e,n,s){if(!s)throw new Error("`"+e+"` finished async. Use `"+n+"` instead")}function ac(e){return OC(e)?e:new Lv(e)}function OC(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function qC(e){return typeof e=="string"||DC(e)}function DC(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const BC="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",ly=[],cy={allowDangerousHtml:!0},WC=/^(https?|ircs?|mailto|xmpp)$/i,UC=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function Zf(e){const n=HC(e),s=VC(e);return KC(n.runSync(n.parse(s),s),e)}function HC(e){const n=e.rehypePlugins||ly,s=e.remarkPlugins||ly,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...cy}:cy;return _C().use(SS).use(s).use(vC,r).use(n)}function VC(e){const n=e.children||"",s=new Lv;return typeof n=="string"&&(s.value=n),s}function KC(e,n){const s=n.allowedElements,r=n.allowElement,a=n.components,o=n.disallowedElements,c=n.skipHtml,u=n.unwrapDisallowed,d=n.urlTransform||YC;for(const f of UC)Object.hasOwn(n,f.from)&&(""+f.from+(f.to?"use `"+f.to+"` instead":"remove it")+BC+f.id,void 0);return n.className&&(e={type:"element",tagName:"div",properties:{className:n.className},children:e.type==="root"?e.children:[e]}),Qf(e,p),lN(e,{Fragment:t.Fragment,components:a,ignoreInvalidStyle:!0,jsx:t.jsx,jsxs:t.jsxs,passKeys:!0,passNode:!0});function p(f,m,y){if(f.type==="raw"&&y&&typeof m=="number")return c?y.children.splice(m,1):y.children[m]={type:"text",value:f.value},m;if(f.type==="element"){let x;for(x in qh)if(Object.hasOwn(qh,x)&&Object.hasOwn(f.properties,x)){const k=f.properties[x],v=qh[x];(v===null||v.includes(f.tagName))&&(f.properties[x]=d(String(k||""),x,f))}}if(f.type==="element"){let x=s?!s.includes(f.tagName):o?o.includes(f.tagName):!1;if(!x&&r&&typeof m=="number"&&(x=!r(f,m,y)),x&&y&&typeof m=="number")return u&&f.children?y.children.splice(m,1,...f.children):y.children.splice(m,1),m}}}function YC(e){const n=e.indexOf(":"),s=e.indexOf("?"),r=e.indexOf("#"),a=e.indexOf("/");return n===-1||a!==-1&&n>a||s!==-1&&n>s||r!==-1&&n>r||WC.test(e.slice(0,n))?e:""}function uy(e,n){const s=String(e);if(typeof n!="string")throw new TypeError("Expected character");let r=0,a=s.indexOf(n);for(;a!==-1;)r++,a=s.indexOf(n,a+n.length);return r}function QC(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}const _v=[],GC=!0,Zh=!1,Gp="skip";function ZC(e,n,s,r){if(!e||typeof e!="object")throw new Error("Unexpected value `"+e+"` for `tree`, expected node");let a,o,c,u;if(o=n,typeof o=="function")c=o;else if(o&&typeof o=="object"){if(!(o.enter===null||o.enter===void 0))if(typeof o.enter=="function")c=o.enter;else throw new Error("Unexpected value `"+o.enter+"` for `visitors.enter`, expected optional visitor");if(typeof o.exit=="function")u=o.exit;else throw new Error("Unexpected value `"+o.exit+"` for `visitors.exit`, expected visitor (pass a visitor directly if you only want an enter visitor)")}else throw new Error("Unexpected value `"+o+"` for `enter` or `visitors`, expected visitor or object with visitors");Oo(a);const d=1;p(e,void 0,[])();function p(f,m,y){const x=f&&typeof f=="object"?f:{};if(typeof x.type=="string"){const v=typeof x.tagName=="string"?x.tagName:typeof x.name=="string"?x.name:void 0;Object.defineProperty(k,"name",{value:"node ("+(f.type+(v?"<"+v+">":""))+")"})}return k;function k(){const v=!a;let b=_v;if(c&&v&&(b=dy(c(f,y,m)),b[0]===Zh))return b;if("children"in f&&f.children){const N=f;if(N.children&&b[0]!==Gp){let C=-1+d;const S=[...y,N];for(;C>-1&&C<N.children.length;){const P=N.children[C],M=p(P,C,S)();if(M[0]===Zh)return M;C=typeof M[1]=="number"?M[1]:C+d}}}if(u&&v){const N=dy(u(f,y,m));if(N[0]===Gp)throw new Error("Unexpected value `"+N[0]+"` from `exit`, expected `CONTINUE`, `EXIT`, index, or nothing");if(N[0]===Zh||typeof N[1]=="number")return N}return b}}}function dy(e){return Array.isArray(e)?e:typeof e=="number"?[GC,e]:e==null?_v:[e]}function XC(e,n,s){const a=Oo((s||{}).ignore||[]),o=JC(n);let c=-1;for(;++c<o.length;)ZC(e,u);function u(p,f,m){if(p.type==="text"&&typeof m=="number")return d(p,f,m);if(a(p,m,f[f.length-1]))return Gp}function d(p,f,m){const y=f[f.length-1],x=o[c][0],k=o[c][1];let v=0,b=!1,N=[];x.lastIndex=0;let C=x.exec(p.value);for(;C;){const P=C.index,M={index:C.index,input:C.input,stack:[...f,p]};let T=k(...C,M);if(typeof T=="string"&&(T=T.length>0?{type:"text",value:T}:void 0),T===!1)x.lastIndex=P+1;else{if(v!==P&&S({type:"text",value:p.value.slice(v,P)}),Array.isArray(T))for(const F of T)S(F);else T&&S(T);v=P+C[0].length,b=!0}if(!x.global)break;C=x.exec(p.value)}return b?(v<p.value.length&&S({type:"text",value:p.value.slice(v)}),y.children.splice(m,1,...N)):N=[p],m+N.length;function S(P){const M=N[N.length-1];M&&M.type==="text"&&P.type==="text"?M.value+=P.value:N.push(P)}}}function JC(e){if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=[],s=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<s.length;){const a=s[r];n.push([e$(a[0]),t$(a[1])])}return n}function e$(e){return typeof e=="string"?new RegExp(QC(e),"g"):e}function t$(e){return typeof e=="function"?e:function(){return e}}const Xh="phrasing",Jh=["autolink","link","image","label"];function n$(){return{transforms:[c$],enter:{literalAutolink:r$,literalAutolinkEmail:ep,literalAutolinkHttp:ep,literalAutolinkWww:ep},exit:{literalAutolink:l$,literalAutolinkEmail:o$,literalAutolinkHttp:i$,literalAutolinkWww:a$}}}function s$(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Xh,notInConstruct:Jh},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Xh,notInConstruct:Jh},{character:":",before:"[ps]",after:"\\/",inConstruct:Xh,notInConstruct:Jh}]}}function r$(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function ep(e){this.config.enter.autolinkProtocol.call(this,e)}function i$(e){this.config.exit.autolinkProtocol.call(this,e)}function a$(e){this.config.exit.data.call(this,e);const n=this.stack[this.stack.length-1];n.type,n.url="http://"+this.sliceSerialize(e)}function o$(e){this.config.exit.autolinkEmail.call(this,e)}function l$(e){this.exit(e)}function c$(e){XC(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,u$],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,d$]],{ignore:["link","linkReference"]})}function u$(e,n,s,r,a){let o="";if(!Ov(a)||(/^w/i.test(n)&&(s=n+s,n="",o="http://"),!h$(s)))return!1;const c=p$(s+r);if(!c[0])return!1;const u={type:"link",title:null,url:o+n+c[0],children:[{type:"text",value:n+c[0]}]};return c[1]?[u,{type:"text",value:c[1]}]:u}function d$(e,n,s,r){return!Ov(r,!0)||/[-\d_]$/.test(s)?!1:{type:"link",title:null,url:"mailto:"+n+"@"+s,children:[{type:"text",value:n+"@"+s}]}}function h$(e){const n=e.split(".");return!(n.length<2||n[n.length-1]&&(/_/.test(n[n.length-1])||!/[a-zA-Z\d]/.test(n[n.length-1]))||n[n.length-2]&&(/_/.test(n[n.length-2])||!/[a-zA-Z\d]/.test(n[n.length-2])))}function p$(e){const n=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!n)return[e,void 0];e=e.slice(0,n.index);let s=n[0],r=s.indexOf(")");const a=uy(e,"(");let o=uy(e,")");for(;r!==-1&&a>o;)e+=s.slice(0,r+1),s=s.slice(r+1),r=s.indexOf(")"),o++;return[e,s]}function Ov(e,n){const s=e.input.charCodeAt(e.index-1);return(e.index===0||Dr(s)||mu(s))&&(!n||s!==47)}qv.peek=b$;function f$(){this.buffer()}function m$(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function g$(){this.buffer()}function x$(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function y$(e){const n=this.resume(),s=this.stack[this.stack.length-1];s.type,s.identifier=Hn(this.sliceSerialize(e)).toLowerCase(),s.label=n}function k$(e){this.exit(e)}function v$(e){const n=this.resume(),s=this.stack[this.stack.length-1];s.type,s.identifier=Hn(this.sliceSerialize(e)).toLowerCase(),s.label=n}function j$(e){this.exit(e)}function b$(){return"["}function qv(e,n,s,r){const a=s.createTracker(r);let o=a.move("[^");const c=s.enter("footnoteReference"),u=s.enter("reference");return o+=a.move(s.safe(s.associationId(e),{after:"]",before:o})),u(),c(),o+=a.move("]"),o}function w$(){return{enter:{gfmFootnoteCallString:f$,gfmFootnoteCall:m$,gfmFootnoteDefinitionLabelString:g$,gfmFootnoteDefinition:x$},exit:{gfmFootnoteCallString:y$,gfmFootnoteCall:k$,gfmFootnoteDefinitionLabelString:v$,gfmFootnoteDefinition:j$}}}function N$(e){let n=!1;return e&&e.firstLineBlank&&(n=!0),{handlers:{footnoteDefinition:s,footnoteReference:qv},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function s(r,a,o,c){const u=o.createTracker(c);let d=u.move("[^");const p=o.enter("footnoteDefinition"),f=o.enter("label");return d+=u.move(o.safe(o.associationId(r),{before:d,after:"]"})),f(),d+=u.move("]:"),r.children&&r.children.length>0&&(u.shift(4),d+=u.move((n?`
576
- `:" ")+o.indentLines(o.containerFlow(r,u.current()),n?Dv:S$))),p(),d}}function S$(e,n,s){return n===0?e:Dv(e,n,s)}function Dv(e,n,s){return(s?"":" ")+e}const C$=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Xf.attention=P$;Xf.peek=R$;function $$(){return{canContainEols:["delete"],enter:{strikethrough:T$},exit:{strikethrough:A$}}}function E$(){return{handlers:{delete:Xf},unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:C$}]}}function T$(e){this.enter({type:"delete",children:[],position:void 0},e)}function A$(e){this.exit(e)}function Xf(e,n,s,r){const a=s.createTracker(r),o=s.stack.includes("strikethrough")?"~":"~~",c=s.enter("strikethrough");let u=a.move(o);return u+=s.containerPhrasing(e,{...a.current(),before:u,after:"~"}),u+=a.move(o),c(),u}function P$(){return{construct:"strikethrough",markers:["~"],sizes:[2,1]}}function R$(){return"~"}function I$(e){return e.length}function z$(e,n){const s=n||{},r=(s.align||[]).concat(),a=s.stringLength||I$,o=[],c=[],u=[],d=[];let p=0,f=-1;for(;++f<e.length;){const v=[],b=[];let N=-1;for(e[f].length>p&&(p=e[f].length);++N<e[f].length;){const C=M$(e[f][N]);if(s.alignDelimiters!==!1){const S=a(C);b[N]=S,(d[N]===void 0||S>d[N])&&(d[N]=S)}v.push(C)}c[f]=v,u[f]=b}let m=-1;if(typeof r=="object"&&"length"in r)for(;++m<p;)o[m]=hy(r[m]);else{const v=hy(r);for(;++m<p;)o[m]=v}m=-1;const y=[],x=[];for(;++m<p;){const v=o[m];let b="",N="";v===99?(b=":",N=":"):v===108?b=":":v===114&&(N=":");let C=s.alignDelimiters===!1?1:Math.max(1,d[m]-b.length-N.length);const S=b+"-".repeat(C)+N;s.alignDelimiters!==!1&&(C=b.length+C+N.length,C>d[m]&&(d[m]=C),x[m]=C),y[m]=S}c.splice(1,0,y),u.splice(1,0,x),f=-1;const k=[];for(;++f<c.length;){const v=c[f],b=u[f];m=-1;const N=[];for(;++m<p;){const C=v[m]||"";let S="",P="";if(s.alignDelimiters!==!1){const M=d[m]-(b[m]||0),T=o[m];T===114?S=" ".repeat(M):T===99?M%2?(S=" ".repeat(M/2+.5),P=" ".repeat(M/2-.5)):(S=" ".repeat(M/2),P=S):P=" ".repeat(M)}s.delimiterStart!==!1&&!m&&N.push("|"),s.padding!==!1&&!(s.alignDelimiters===!1&&C==="")&&(s.delimiterStart!==!1||m)&&N.push(" "),s.alignDelimiters!==!1&&N.push(S),N.push(C),s.alignDelimiters!==!1&&N.push(P),s.padding!==!1&&N.push(" "),(s.delimiterEnd!==!1||m!==p-1)&&N.push("|")}k.push(s.delimiterEnd===!1?N.join("").replace(/ +$/,""):N.join(""))}return k.join(`
577
- `)}function M$(e){return e==null?"":String(e)}function hy(e){const n=typeof e=="string"?e.codePointAt(0):0;return n===67||n===99?99:n===76||n===108?108:n===82||n===114?114:0}function F$(e,n,s,r){const a=s.enter("blockquote"),o=s.createTracker(r);o.move("> "),o.shift(2);const c=s.indentLines(s.containerFlow(e,o.current()),L$);return a(),c}function L$(e,n,s){return">"+(s?"":" ")+e}function _$(e,n){return py(e,n.inConstruct,!0)&&!py(e,n.notInConstruct,!1)}function py(e,n,s){if(typeof n=="string"&&(n=[n]),!n||n.length===0)return s;let r=-1;for(;++r<n.length;)if(e.includes(n[r]))return!0;return!1}function fy(e,n,s,r){let a=-1;for(;++a<s.unsafe.length;)if(s.unsafe[a].character===`
578
- `&&_$(s.stack,s.unsafe[a]))return/[ \t]/.test(r.before)?"":" ";return`\\
579
- `}function O$(e,n){const s=String(e);let r=s.indexOf(n),a=r,o=0,c=0;if(typeof n!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===a?++o>c&&(c=o):o=1,a=r+n.length,r=s.indexOf(n,a);return c}function q$(e,n){return!!(n.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function D$(e){const n=e.options.fence||"`";if(n!=="`"&&n!=="~")throw new Error("Cannot serialize code with `"+n+"` for `options.fence`, expected `` ` `` or `~`");return n}function B$(e,n,s,r){const a=D$(s),o=e.value||"",c=a==="`"?"GraveAccent":"Tilde";if(q$(e,s)){const m=s.enter("codeIndented"),y=s.indentLines(o,W$);return m(),y}const u=s.createTracker(r),d=a.repeat(Math.max(O$(o,a)+1,3)),p=s.enter("codeFenced");let f=u.move(d);if(e.lang){const m=s.enter(`codeFencedLang${c}`);f+=u.move(s.safe(e.lang,{before:f,after:" ",encode:["`"],...u.current()})),m()}if(e.lang&&e.meta){const m=s.enter(`codeFencedMeta${c}`);f+=u.move(" "),f+=u.move(s.safe(e.meta,{before:f,after:`
580
- `,encode:["`"],...u.current()})),m()}return f+=u.move(`
581
- `),o&&(f+=u.move(o+`
582
- `)),f+=u.move(d),p(),f}function W$(e,n,s){return(s?"":" ")+e}function Jf(e){const n=e.options.quote||'"';if(n!=='"'&&n!=="'")throw new Error("Cannot serialize title with `"+n+"` for `options.quote`, expected `\"`, or `'`");return n}function U$(e,n,s,r){const a=Jf(s),o=a==='"'?"Quote":"Apostrophe",c=s.enter("definition");let u=s.enter("label");const d=s.createTracker(r);let p=d.move("[");return p+=d.move(s.safe(s.associationId(e),{before:p,after:"]",...d.current()})),p+=d.move("]: "),u(),!e.url||/[\0- \u007F]/.test(e.url)?(u=s.enter("destinationLiteral"),p+=d.move("<"),p+=d.move(s.safe(e.url,{before:p,after:">",...d.current()})),p+=d.move(">")):(u=s.enter("destinationRaw"),p+=d.move(s.safe(e.url,{before:p,after:e.title?" ":`
583
- `,...d.current()}))),u(),e.title&&(u=s.enter(`title${o}`),p+=d.move(" "+a),p+=d.move(s.safe(e.title,{before:p,after:a,...d.current()})),p+=d.move(a),u()),c(),p}function H$(e){const n=e.options.emphasis||"*";if(n!=="*"&&n!=="_")throw new Error("Cannot serialize emphasis with `"+n+"` for `options.emphasis`, expected `*`, or `_`");return n}function po(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Hc(e,n,s){const r=Fi(e),a=Fi(n);return r===void 0?a===void 0?s==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:a===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?a===void 0?{inside:!1,outside:!1}:a===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:a===void 0?{inside:!1,outside:!1}:a===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}Bv.peek=V$;function Bv(e,n,s,r){const a=H$(s),o=s.enter("emphasis"),c=s.createTracker(r),u=c.move(a);let d=c.move(s.containerPhrasing(e,{after:a,before:u,...c.current()}));const p=d.charCodeAt(0),f=Hc(r.before.charCodeAt(r.before.length-1),p,a);f.inside&&(d=po(p)+d.slice(1));const m=d.charCodeAt(d.length-1),y=Hc(r.after.charCodeAt(0),m,a);y.inside&&(d=d.slice(0,-1)+po(m));const x=c.move(a);return o(),s.attentionEncodeSurroundingInfo={after:y.outside,before:f.outside},u+d+x}function V$(e,n,s){return s.options.emphasis||"*"}function K$(e,n){let s=!1;return Qf(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return s=!0,Vp}),!!((!e.depth||e.depth<3)&&Bf(e)&&(n.options.setext||s))}function Y$(e,n,s,r){const a=Math.max(Math.min(6,e.depth||1),1),o=s.createTracker(r);if(K$(e,s)){const f=s.enter("headingSetext"),m=s.enter("phrasing"),y=s.containerPhrasing(e,{...o.current(),before:`
584
- `,after:`
585
- `});return m(),f(),y+`
586
- `+(a===1?"=":"-").repeat(y.length-(Math.max(y.lastIndexOf("\r"),y.lastIndexOf(`
587
- `))+1))}const c="#".repeat(a),u=s.enter("headingAtx"),d=s.enter("phrasing");o.move(c+" ");let p=s.containerPhrasing(e,{before:"# ",after:`
588
- `,...o.current()});return/^[\t ]/.test(p)&&(p=po(p.charCodeAt(0))+p.slice(1)),p=p?c+" "+p:c,s.options.closeAtx&&(p+=" "+c),d(),u(),p}Wv.peek=Q$;function Wv(e){return e.value||""}function Q$(){return"<"}Uv.peek=G$;function Uv(e,n,s,r){const a=Jf(s),o=a==='"'?"Quote":"Apostrophe",c=s.enter("image");let u=s.enter("label");const d=s.createTracker(r);let p=d.move("![");return p+=d.move(s.safe(e.alt,{before:p,after:"]",...d.current()})),p+=d.move("]("),u(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(u=s.enter("destinationLiteral"),p+=d.move("<"),p+=d.move(s.safe(e.url,{before:p,after:">",...d.current()})),p+=d.move(">")):(u=s.enter("destinationRaw"),p+=d.move(s.safe(e.url,{before:p,after:e.title?" ":")",...d.current()}))),u(),e.title&&(u=s.enter(`title${o}`),p+=d.move(" "+a),p+=d.move(s.safe(e.title,{before:p,after:a,...d.current()})),p+=d.move(a),u()),p+=d.move(")"),c(),p}function G$(){return"!"}Hv.peek=Z$;function Hv(e,n,s,r){const a=e.referenceType,o=s.enter("imageReference");let c=s.enter("label");const u=s.createTracker(r);let d=u.move("![");const p=s.safe(e.alt,{before:d,after:"]",...u.current()});d+=u.move(p+"]["),c();const f=s.stack;s.stack=[],c=s.enter("reference");const m=s.safe(s.associationId(e),{before:d,after:"]",...u.current()});return c(),s.stack=f,o(),a==="full"||!p||p!==m?d+=u.move(m+"]"):a==="shortcut"?d=d.slice(0,-1):d+=u.move("]"),d}function Z$(){return"!"}Vv.peek=X$;function Vv(e,n,s){let r=e.value||"",a="`",o=-1;for(;new RegExp("(^|[^`])"+a+"([^`]|$)").test(r);)a+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++o<s.unsafe.length;){const c=s.unsafe[o],u=s.compilePattern(c);let d;if(c.atBreak)for(;d=u.exec(r);){let p=d.index;r.charCodeAt(p)===10&&r.charCodeAt(p-1)===13&&p--,r=r.slice(0,p)+" "+r.slice(d.index+1)}}return a+r+a}function X$(){return"`"}function Kv(e,n){const s=Bf(e);return!!(!n.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(s===e.url||"mailto:"+s===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}Yv.peek=J$;function Yv(e,n,s,r){const a=Jf(s),o=a==='"'?"Quote":"Apostrophe",c=s.createTracker(r);let u,d;if(Kv(e,s)){const f=s.stack;s.stack=[],u=s.enter("autolink");let m=c.move("<");return m+=c.move(s.containerPhrasing(e,{before:m,after:">",...c.current()})),m+=c.move(">"),u(),s.stack=f,m}u=s.enter("link"),d=s.enter("label");let p=c.move("[");return p+=c.move(s.containerPhrasing(e,{before:p,after:"](",...c.current()})),p+=c.move("]("),d(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(d=s.enter("destinationLiteral"),p+=c.move("<"),p+=c.move(s.safe(e.url,{before:p,after:">",...c.current()})),p+=c.move(">")):(d=s.enter("destinationRaw"),p+=c.move(s.safe(e.url,{before:p,after:e.title?" ":")",...c.current()}))),d(),e.title&&(d=s.enter(`title${o}`),p+=c.move(" "+a),p+=c.move(s.safe(e.title,{before:p,after:a,...c.current()})),p+=c.move(a),d()),p+=c.move(")"),u(),p}function J$(e,n,s){return Kv(e,s)?"<":"["}Qv.peek=eE;function Qv(e,n,s,r){const a=e.referenceType,o=s.enter("linkReference");let c=s.enter("label");const u=s.createTracker(r);let d=u.move("[");const p=s.containerPhrasing(e,{before:d,after:"]",...u.current()});d+=u.move(p+"]["),c();const f=s.stack;s.stack=[],c=s.enter("reference");const m=s.safe(s.associationId(e),{before:d,after:"]",...u.current()});return c(),s.stack=f,o(),a==="full"||!p||p!==m?d+=u.move(m+"]"):a==="shortcut"?d=d.slice(0,-1):d+=u.move("]"),d}function eE(){return"["}function em(e){const n=e.options.bullet||"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bullet`, expected `*`, `+`, or `-`");return n}function tE(e){const n=em(e),s=e.options.bulletOther;if(!s)return n==="*"?"-":"*";if(s!=="*"&&s!=="+"&&s!=="-")throw new Error("Cannot serialize items with `"+s+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(s===n)throw new Error("Expected `bullet` (`"+n+"`) and `bulletOther` (`"+s+"`) to be different");return s}function nE(e){const n=e.options.bulletOrdered||".";if(n!=="."&&n!==")")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOrdered`, expected `.` or `)`");return n}function Gv(e){const n=e.options.rule||"*";if(n!=="*"&&n!=="-"&&n!=="_")throw new Error("Cannot serialize rules with `"+n+"` for `options.rule`, expected `*`, `-`, or `_`");return n}function sE(e,n,s,r){const a=s.enter("list"),o=s.bulletCurrent;let c=e.ordered?nE(s):em(s);const u=e.ordered?c==="."?")":".":tE(s);let d=n&&s.bulletLastUsed?c===s.bulletLastUsed:!1;if(!e.ordered){const f=e.children?e.children[0]:void 0;if((c==="*"||c==="-")&&f&&(!f.children||!f.children[0])&&s.stack[s.stack.length-1]==="list"&&s.stack[s.stack.length-2]==="listItem"&&s.stack[s.stack.length-3]==="list"&&s.stack[s.stack.length-4]==="listItem"&&s.indexStack[s.indexStack.length-1]===0&&s.indexStack[s.indexStack.length-2]===0&&s.indexStack[s.indexStack.length-3]===0&&(d=!0),Gv(s)===c&&f){let m=-1;for(;++m<e.children.length;){const y=e.children[m];if(y&&y.type==="listItem"&&y.children&&y.children[0]&&y.children[0].type==="thematicBreak"){d=!0;break}}}}d&&(c=u),s.bulletCurrent=c;const p=s.containerFlow(e,r);return s.bulletLastUsed=c,s.bulletCurrent=o,a(),p}function rE(e){const n=e.options.listItemIndent||"one";if(n!=="tab"&&n!=="one"&&n!=="mixed")throw new Error("Cannot serialize items with `"+n+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return n}function iE(e,n,s,r){const a=rE(s);let o=s.bulletCurrent||em(s);n&&n.type==="list"&&n.ordered&&(o=(typeof n.start=="number"&&n.start>-1?n.start:1)+(s.options.incrementListMarker===!1?0:n.children.indexOf(e))+o);let c=o.length+1;(a==="tab"||a==="mixed"&&(n&&n.type==="list"&&n.spread||e.spread))&&(c=Math.ceil(c/4)*4);const u=s.createTracker(r);u.move(o+" ".repeat(c-o.length)),u.shift(c);const d=s.enter("listItem"),p=s.indentLines(s.containerFlow(e,u.current()),f);return d(),p;function f(m,y,x){return y?(x?"":" ".repeat(c))+m:(x?o:o+" ".repeat(c-o.length))+m}}function aE(e,n,s,r){const a=s.enter("paragraph"),o=s.enter("phrasing"),c=s.containerPhrasing(e,r);return o(),a(),c}const oE=Oo(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function lE(e,n,s,r){return(e.children.some(function(c){return oE(c)})?s.containerPhrasing:s.containerFlow).call(s,e,r)}function cE(e){const n=e.options.strong||"*";if(n!=="*"&&n!=="_")throw new Error("Cannot serialize strong with `"+n+"` for `options.strong`, expected `*`, or `_`");return n}Zv.peek=uE;function Zv(e,n,s,r){const a=cE(s),o=s.enter("strong"),c=s.createTracker(r),u=c.move(a+a);let d=c.move(s.containerPhrasing(e,{after:a,before:u,...c.current()}));const p=d.charCodeAt(0),f=Hc(r.before.charCodeAt(r.before.length-1),p,a);f.inside&&(d=po(p)+d.slice(1));const m=d.charCodeAt(d.length-1),y=Hc(r.after.charCodeAt(0),m,a);y.inside&&(d=d.slice(0,-1)+po(m));const x=c.move(a+a);return o(),s.attentionEncodeSurroundingInfo={after:y.outside,before:f.outside},u+d+x}function uE(e,n,s){return s.options.strong||"*"}function dE(e,n,s,r){return s.safe(e.value,r)}function hE(e){const n=e.options.ruleRepetition||3;if(n<3)throw new Error("Cannot serialize rules with repetition `"+n+"` for `options.ruleRepetition`, expected `3` or more");return n}function pE(e,n,s){const r=(Gv(s)+(s.options.ruleSpaces?" ":"")).repeat(hE(s));return s.options.ruleSpaces?r.slice(0,-1):r}const Xv={blockquote:F$,break:fy,code:B$,definition:U$,emphasis:Bv,hardBreak:fy,heading:Y$,html:Wv,image:Uv,imageReference:Hv,inlineCode:Vv,link:Yv,linkReference:Qv,list:sE,listItem:iE,paragraph:aE,root:lE,strong:Zv,text:dE,thematicBreak:pE};function fE(){return{enter:{table:mE,tableData:my,tableHeader:my,tableRow:xE},exit:{codeText:yE,table:gE,tableData:tp,tableHeader:tp,tableRow:tp}}}function mE(e){const n=e._align;this.enter({type:"table",align:n.map(function(s){return s==="none"?null:s}),children:[]},e),this.data.inTable=!0}function gE(e){this.exit(e),this.data.inTable=void 0}function xE(e){this.enter({type:"tableRow",children:[]},e)}function tp(e){this.exit(e)}function my(e){this.enter({type:"tableCell",children:[]},e)}function yE(e){let n=this.resume();this.data.inTable&&(n=n.replace(/\\([\\|])/g,kE));const s=this.stack[this.stack.length-1];s.type,s.value=n,this.exit(e)}function kE(e,n){return n==="|"?n:e}function vE(e){const n=e||{},s=n.tableCellPadding,r=n.tablePipeAlign,a=n.stringLength,o=s?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
589
- `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:y,table:c,tableCell:d,tableRow:u}};function c(x,k,v,b){return p(f(x,v,b),x.align)}function u(x,k,v,b){const N=m(x,v,b),C=p([N]);return C.slice(0,C.indexOf(`
590
- `))}function d(x,k,v,b){const N=v.enter("tableCell"),C=v.enter("phrasing"),S=v.containerPhrasing(x,{...b,before:o,after:o});return C(),N(),S}function p(x,k){return z$(x,{align:k,alignDelimiters:r,padding:s,stringLength:a})}function f(x,k,v){const b=x.children;let N=-1;const C=[],S=k.enter("table");for(;++N<b.length;)C[N]=m(b[N],k,v);return S(),C}function m(x,k,v){const b=x.children;let N=-1;const C=[],S=k.enter("tableRow");for(;++N<b.length;)C[N]=d(b[N],x,k,v);return S(),C}function y(x,k,v){let b=Xv.inlineCode(x,k,v);return v.stack.includes("tableCell")&&(b=b.replace(/\|/g,"\\$&")),b}}function jE(){return{exit:{taskListCheckValueChecked:gy,taskListCheckValueUnchecked:gy,paragraph:wE}}}function bE(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:NE}}}function gy(e){const n=this.stack[this.stack.length-2];n.type,n.checked=e.type==="taskListCheckValueChecked"}function wE(e){const n=this.stack[this.stack.length-2];if(n&&n.type==="listItem"&&typeof n.checked=="boolean"){const s=this.stack[this.stack.length-1];s.type;const r=s.children[0];if(r&&r.type==="text"){const a=n.children;let o=-1,c;for(;++o<a.length;){const u=a[o];if(u.type==="paragraph"){c=u;break}}c===s&&(r.value=r.value.slice(1),r.value.length===0?s.children.shift():s.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,s.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function NE(e,n,s,r){const a=e.children[0],o=typeof e.checked=="boolean"&&a&&a.type==="paragraph",c="["+(e.checked?"x":" ")+"] ",u=s.createTracker(r);o&&u.move(c);let d=Xv.listItem(e,n,s,{...r,...u.current()});return o&&(d=d.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,p)),d;function p(f){return f+c}}function SE(){return[n$(),w$(),$$(),fE(),jE()]}function CE(e){return{extensions:[s$(),N$(e),E$(),vE(e),bE()]}}const $E={tokenize:IE,partial:!0},Jv={tokenize:zE,partial:!0},ej={tokenize:ME,partial:!0},tj={tokenize:FE,partial:!0},EE={tokenize:LE,partial:!0},nj={name:"wwwAutolink",tokenize:PE,previous:rj},sj={name:"protocolAutolink",tokenize:RE,previous:ij},zs={name:"emailAutolink",tokenize:AE,previous:aj},ps={};function TE(){return{text:ps}}let Er=48;for(;Er<123;)ps[Er]=zs,Er++,Er===58?Er=65:Er===91&&(Er=97);ps[43]=zs;ps[45]=zs;ps[46]=zs;ps[95]=zs;ps[72]=[zs,sj];ps[104]=[zs,sj];ps[87]=[zs,nj];ps[119]=[zs,nj];function AE(e,n,s){const r=this;let a,o;return c;function c(m){return!Zp(m)||!aj.call(r,r.previous)||tm(r.events)?s(m):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),u(m))}function u(m){return Zp(m)?(e.consume(m),u):m===64?(e.consume(m),d):s(m)}function d(m){return m===46?e.check(EE,f,p)(m):m===45||m===95||Ft(m)?(o=!0,e.consume(m),d):f(m)}function p(m){return e.consume(m),a=!0,d}function f(m){return o&&a&&Wt(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),n(m)):s(m)}}function PE(e,n,s){const r=this;return a;function a(c){return c!==87&&c!==119||!rj.call(r,r.previous)||tm(r.events)?s(c):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check($E,e.attempt(Jv,e.attempt(ej,o),s),s)(c))}function o(c){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),n(c)}}function RE(e,n,s){const r=this;let a="",o=!1;return c;function c(m){return(m===72||m===104)&&ij.call(r,r.previous)&&!tm(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),a+=String.fromCodePoint(m),e.consume(m),u):s(m)}function u(m){if(Wt(m)&&a.length<5)return a+=String.fromCodePoint(m),e.consume(m),u;if(m===58){const y=a.toLowerCase();if(y==="http"||y==="https")return e.consume(m),d}return s(m)}function d(m){return m===47?(e.consume(m),o?p:(o=!0,d)):s(m)}function p(m){return m===null||Bc(m)||Ye(m)||Dr(m)||mu(m)?s(m):e.attempt(Jv,e.attempt(ej,f),s)(m)}function f(m){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),n(m)}}function IE(e,n,s){let r=0;return a;function a(c){return(c===87||c===119)&&r<3?(r++,e.consume(c),a):c===46&&r===3?(e.consume(c),o):s(c)}function o(c){return c===null?s(c):n(c)}}function zE(e,n,s){let r,a,o;return c;function c(p){return p===46||p===95?e.check(tj,d,u)(p):p===null||Ye(p)||Dr(p)||p!==45&&mu(p)?d(p):(o=!0,e.consume(p),c)}function u(p){return p===95?r=!0:(a=r,r=void 0),e.consume(p),c}function d(p){return a||r||!o?s(p):n(p)}}function ME(e,n){let s=0,r=0;return a;function a(c){return c===40?(s++,e.consume(c),a):c===41&&r<s?o(c):c===33||c===34||c===38||c===39||c===41||c===42||c===44||c===46||c===58||c===59||c===60||c===63||c===93||c===95||c===126?e.check(tj,n,o)(c):c===null||Ye(c)||Dr(c)?n(c):(e.consume(c),a)}function o(c){return c===41&&r++,e.consume(c),a}}function FE(e,n,s){return r;function r(u){return u===33||u===34||u===39||u===41||u===42||u===44||u===46||u===58||u===59||u===63||u===95||u===126?(e.consume(u),r):u===38?(e.consume(u),o):u===93?(e.consume(u),a):u===60||u===null||Ye(u)||Dr(u)?n(u):s(u)}function a(u){return u===null||u===40||u===91||Ye(u)||Dr(u)?n(u):r(u)}function o(u){return Wt(u)?c(u):s(u)}function c(u){return u===59?(e.consume(u),r):Wt(u)?(e.consume(u),c):s(u)}}function LE(e,n,s){return r;function r(o){return e.consume(o),a}function a(o){return Ft(o)?s(o):n(o)}}function rj(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Ye(e)}function ij(e){return!Wt(e)}function aj(e){return!(e===47||Zp(e))}function Zp(e){return e===43||e===45||e===46||e===95||Ft(e)}function tm(e){let n=e.length,s=!1;for(;n--;){const r=e[n][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){s=!0;break}if(r._gfmAutolinkLiteralWalkedInto){s=!1;break}}return e.length>0&&!s&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),s}const _E={tokenize:VE,partial:!0};function OE(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:WE,continuation:{tokenize:UE},exit:HE}},text:{91:{name:"gfmFootnoteCall",tokenize:BE},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:qE,resolveTo:DE}}}}function qE(e,n,s){const r=this;let a=r.events.length;const o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let c;for(;a--;){const d=r.events[a][1];if(d.type==="labelImage"){c=d;break}if(d.type==="gfmFootnoteCall"||d.type==="labelLink"||d.type==="label"||d.type==="image"||d.type==="link")break}return u;function u(d){if(!c||!c._balanced)return s(d);const p=Hn(r.sliceSerialize({start:c.end,end:r.now()}));return p.codePointAt(0)!==94||!o.includes(p.slice(1))?s(d):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),n(d))}}function DE(e,n){let s=e.length;for(;s--;)if(e[s][1].type==="labelImage"&&e[s][0]==="enter"){e[s][1];break}e[s+1][1].type="data",e[s+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[s+3][1].start),end:Object.assign({},e[e.length-1][1].end)},a={type:"gfmFootnoteCallMarker",start:Object.assign({},e[s+3][1].end),end:Object.assign({},e[s+3][1].end)};a.end.column++,a.end.offset++,a.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},a.end),end:Object.assign({},e[e.length-1][1].start)},c={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},u=[e[s+1],e[s+2],["enter",r,n],e[s+3],e[s+4],["enter",a,n],["exit",a,n],["enter",o,n],["enter",c,n],["exit",c,n],["exit",o,n],e[e.length-2],e[e.length-1],["exit",r,n]];return e.splice(s,e.length-s+1,...u),e}function BE(e,n,s){const r=this,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o=0,c;return u;function u(m){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),d}function d(m){return m!==94?s(m):(e.enter("gfmFootnoteCallMarker"),e.consume(m),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",p)}function p(m){if(o>999||m===93&&!c||m===null||m===91||Ye(m))return s(m);if(m===93){e.exit("chunkString");const y=e.exit("gfmFootnoteCallString");return a.includes(Hn(r.sliceSerialize(y)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),n):s(m)}return Ye(m)||(c=!0),o++,e.consume(m),m===92?f:p}function f(m){return m===91||m===92||m===93?(e.consume(m),o++,p):p(m)}}function WE(e,n,s){const r=this,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o,c=0,u;return d;function d(k){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionLabelMarker"),p}function p(k){return k===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",f):s(k)}function f(k){if(c>999||k===93&&!u||k===null||k===91||Ye(k))return s(k);if(k===93){e.exit("chunkString");const v=e.exit("gfmFootnoteDefinitionLabelString");return o=Hn(r.sliceSerialize(v)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),y}return Ye(k)||(u=!0),c++,e.consume(k),k===92?m:f}function m(k){return k===91||k===92||k===93?(e.consume(k),c++,f):f(k)}function y(k){return k===58?(e.enter("definitionMarker"),e.consume(k),e.exit("definitionMarker"),a.includes(o)||a.push(o),Be(e,x,"gfmFootnoteDefinitionWhitespace")):s(k)}function x(k){return n(k)}}function UE(e,n,s){return e.check(_o,n,e.attempt(_E,n,s))}function HE(e){e.exit("gfmFootnoteDefinition")}function VE(e,n,s){const r=this;return Be(e,a,"gfmFootnoteDefinitionIndent",5);function a(o){const c=r.events[r.events.length-1];return c&&c[1].type==="gfmFootnoteDefinitionIndent"&&c[2].sliceSerialize(c[1],!0).length===4?n(o):s(o)}}function KE(e){let s=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:o,resolveAll:a};return s==null&&(s=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function a(c,u){let d=-1;for(;++d<c.length;)if(c[d][0]==="enter"&&c[d][1].type==="strikethroughSequenceTemporary"&&c[d][1]._close){let p=d;for(;p--;)if(c[p][0]==="exit"&&c[p][1].type==="strikethroughSequenceTemporary"&&c[p][1]._open&&c[d][1].end.offset-c[d][1].start.offset===c[p][1].end.offset-c[p][1].start.offset){c[d][1].type="strikethroughSequence",c[p][1].type="strikethroughSequence";const f={type:"strikethrough",start:Object.assign({},c[p][1].start),end:Object.assign({},c[d][1].end)},m={type:"strikethroughText",start:Object.assign({},c[p][1].end),end:Object.assign({},c[d][1].start)},y=[["enter",f,u],["enter",c[p][1],u],["exit",c[p][1],u],["enter",m,u]],x=u.parser.constructs.insideSpan.null;x&&kn(y,y.length,0,gu(x,c.slice(p+1,d),u)),kn(y,y.length,0,[["exit",m,u],["enter",c[d][1],u],["exit",c[d][1],u],["exit",f,u]]),kn(c,p-1,d-p+3,y),d=p+y.length-2;break}}for(d=-1;++d<c.length;)c[d][1].type==="strikethroughSequenceTemporary"&&(c[d][1].type="data");return c}function o(c,u,d){const p=this.previous,f=this.events;let m=0;return y;function y(k){return p===126&&f[f.length-1][1].type!=="characterEscape"?d(k):(c.enter("strikethroughSequenceTemporary"),x(k))}function x(k){const v=Fi(p);if(k===126)return m>1?d(k):(c.consume(k),m++,x);if(m<2&&!s)return d(k);const b=c.exit("strikethroughSequenceTemporary"),N=Fi(k);return b._open=!N||N===2&&!!v,b._close=!v||v===2&&!!N,u(k)}}}class YE{constructor(){this.map=[],this.index=new Map}add(n,s,r){QE(this,n,s,r)}consume(n){if(this.map.sort(function(o,c){return o[0]-c[0]}),this.map.length===0)return;let s=this.map.length;const r=[];for(;s>0;)s-=1,r.push(n.slice(this.map[s][0]+this.map[s][1]),this.map[s][2]),n.length=this.map[s][0];r.push(n.slice()),n.length=0;let a=r.pop();for(;a;){for(const o of a)n.push(o);a=r.pop()}this.map.length=0,this.index.clear()}}function QE(e,n,s,r){if(s===0&&r.length===0)return;const a=e.index.get(n);if(a){a[1]+=s,a[2].push(...r);return}const o=[n,s,r];e.map.push(o),e.index.set(n,o)}function GE(e,n){let s=!1;const r=[];for(;n<e.length;){const a=e[n];if(s){if(a[0]==="enter")a[1].type==="tableContent"&&r.push(e[n+1][1].type==="tableDelimiterMarker"?"left":"none");else if(a[1].type==="tableContent"){if(e[n-1][1].type==="tableDelimiterMarker"){const o=r.length-1;r[o]=r[o]==="left"?"center":"right"}}else if(a[1].type==="tableDelimiterRow")break}else a[0]==="enter"&&a[1].type==="tableDelimiterRow"&&(s=!0);n+=1}return r}function ZE(){return{flow:{null:{name:"table",tokenize:XE,resolveAll:JE}}}}function XE(e,n,s){const r=this;let a=0,o=0,c;return u;function u(I){let O=r.events.length-1;for(;O>-1;){const{type:q}=r.events[O][1];if(q==="lineEnding"||q==="linePrefix")O--;else break}const _=O>-1?r.events[O][1].type:null,Q=_==="tableHead"||_==="tableRow"?T:d;return Q===T&&r.parser.lazy[r.now().line]?s(I):Q(I)}function d(I){return e.enter("tableHead"),e.enter("tableRow"),p(I)}function p(I){return I===124||(c=!0,o+=1),f(I)}function f(I){return I===null?s(I):Ce(I)?o>1?(o=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),x):s(I):Oe(I)?Be(e,f,"whitespace")(I):(o+=1,c&&(c=!1,a+=1),I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),c=!0,f):(e.enter("data"),m(I)))}function m(I){return I===null||I===124||Ye(I)?(e.exit("data"),f(I)):(e.consume(I),I===92?y:m)}function y(I){return I===92||I===124?(e.consume(I),m):m(I)}function x(I){return r.interrupt=!1,r.parser.lazy[r.now().line]?s(I):(e.enter("tableDelimiterRow"),c=!1,Oe(I)?Be(e,k,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):k(I))}function k(I){return I===45||I===58?b(I):I===124?(c=!0,e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),v):M(I)}function v(I){return Oe(I)?Be(e,b,"whitespace")(I):b(I)}function b(I){return I===58?(o+=1,c=!0,e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),N):I===45?(o+=1,N(I)):I===null||Ce(I)?P(I):M(I)}function N(I){return I===45?(e.enter("tableDelimiterFiller"),C(I)):M(I)}function C(I){return I===45?(e.consume(I),C):I===58?(c=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),S):(e.exit("tableDelimiterFiller"),S(I))}function S(I){return Oe(I)?Be(e,P,"whitespace")(I):P(I)}function P(I){return I===124?k(I):I===null||Ce(I)?!c||a!==o?M(I):(e.exit("tableDelimiterRow"),e.exit("tableHead"),n(I)):M(I)}function M(I){return s(I)}function T(I){return e.enter("tableRow"),F(I)}function F(I){return I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),F):I===null||Ce(I)?(e.exit("tableRow"),n(I)):Oe(I)?Be(e,F,"whitespace")(I):(e.enter("data"),R(I))}function R(I){return I===null||I===124||Ye(I)?(e.exit("data"),F(I)):(e.consume(I),I===92?B:R)}function B(I){return I===92||I===124?(e.consume(I),R):R(I)}}function JE(e,n){let s=-1,r=!0,a=0,o=[0,0,0,0],c=[0,0,0,0],u=!1,d=0,p,f,m;const y=new YE;for(;++s<e.length;){const x=e[s],k=x[1];x[0]==="enter"?k.type==="tableHead"?(u=!1,d!==0&&(xy(y,n,d,p,f),f=void 0,d=0),p={type:"table",start:Object.assign({},k.start),end:Object.assign({},k.end)},y.add(s,0,[["enter",p,n]])):k.type==="tableRow"||k.type==="tableDelimiterRow"?(r=!0,m=void 0,o=[0,0,0,0],c=[0,s+1,0,0],u&&(u=!1,f={type:"tableBody",start:Object.assign({},k.start),end:Object.assign({},k.end)},y.add(s,0,[["enter",f,n]])),a=k.type==="tableDelimiterRow"?2:f?3:1):a&&(k.type==="data"||k.type==="tableDelimiterMarker"||k.type==="tableDelimiterFiller")?(r=!1,c[2]===0&&(o[1]!==0&&(c[0]=c[1],m=oc(y,n,o,a,void 0,m),o=[0,0,0,0]),c[2]=s)):k.type==="tableCellDivider"&&(r?r=!1:(o[1]!==0&&(c[0]=c[1],m=oc(y,n,o,a,void 0,m)),o=c,c=[o[1],s,0,0])):k.type==="tableHead"?(u=!0,d=s):k.type==="tableRow"||k.type==="tableDelimiterRow"?(d=s,o[1]!==0?(c[0]=c[1],m=oc(y,n,o,a,s,m)):c[1]!==0&&(m=oc(y,n,c,a,s,m)),a=0):a&&(k.type==="data"||k.type==="tableDelimiterMarker"||k.type==="tableDelimiterFiller")&&(c[3]=s)}for(d!==0&&xy(y,n,d,p,f),y.consume(n.events),s=-1;++s<n.events.length;){const x=n.events[s];x[0]==="enter"&&x[1].type==="table"&&(x[1]._align=GE(n.events,s))}return e}function oc(e,n,s,r,a,o){const c=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",u="tableContent";s[0]!==0&&(o.end=Object.assign({},Ei(n.events,s[0])),e.add(s[0],0,[["exit",o,n]]));const d=Ei(n.events,s[1]);if(o={type:c,start:Object.assign({},d),end:Object.assign({},d)},e.add(s[1],0,[["enter",o,n]]),s[2]!==0){const p=Ei(n.events,s[2]),f=Ei(n.events,s[3]),m={type:u,start:Object.assign({},p),end:Object.assign({},f)};if(e.add(s[2],0,[["enter",m,n]]),r!==2){const y=n.events[s[2]],x=n.events[s[3]];if(y[1].end=Object.assign({},x[1].end),y[1].type="chunkText",y[1].contentType="text",s[3]>s[2]+1){const k=s[2]+1,v=s[3]-s[2]-1;e.add(k,v,[])}}e.add(s[3]+1,0,[["exit",m,n]])}return a!==void 0&&(o.end=Object.assign({},Ei(n.events,a)),e.add(a,0,[["exit",o,n]]),o=void 0),o}function xy(e,n,s,r,a){const o=[],c=Ei(n.events,s);a&&(a.end=Object.assign({},c),o.push(["exit",a,n])),r.end=Object.assign({},c),o.push(["exit",r,n]),e.add(s+1,0,o)}function Ei(e,n){const s=e[n],r=s[0]==="enter"?"start":"end";return s[1][r]}const eT={name:"tasklistCheck",tokenize:nT};function tT(){return{text:{91:eT}}}function nT(e,n,s){const r=this;return a;function a(d){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?s(d):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(d),e.exit("taskListCheckMarker"),o)}function o(d){return Ye(d)?(e.enter("taskListCheckValueUnchecked"),e.consume(d),e.exit("taskListCheckValueUnchecked"),c):d===88||d===120?(e.enter("taskListCheckValueChecked"),e.consume(d),e.exit("taskListCheckValueChecked"),c):s(d)}function c(d){return d===93?(e.enter("taskListCheckMarker"),e.consume(d),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),u):s(d)}function u(d){return Ce(d)?n(d):Oe(d)?e.check({tokenize:sT},n,s)(d):s(d)}}function sT(e,n,s){return Be(e,r,"whitespace");function r(a){return a===null?s(a):n(a)}}function rT(e){return yv([TE(),OE(),KE(e),ZE(),tT()])}const iT={};function nm(e){const n=this,s=e||iT,r=n.data(),a=r.micromarkExtensions||(r.micromarkExtensions=[]),o=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),c=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);a.push(rT(s)),o.push(SE()),c.push(CE(s))}function oj(e){var n,s,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(n=0;n<a;n++)e[n]&&(s=oj(e[n]))&&(r&&(r+=" "),r+=s)}else for(s in e)e[s]&&(r&&(r+=" "),r+=s);return r}function lj(){for(var e,n,s=0,r="",a=arguments.length;s<a;s++)(e=arguments[s])&&(n=oj(e))&&(r&&(r+=" "),r+=n);return r}var aT=Object.create,ku=Object.defineProperty,oT=Object.defineProperties,lT=Object.getOwnPropertyDescriptor,cT=Object.getOwnPropertyDescriptors,cj=Object.getOwnPropertyNames,Vc=Object.getOwnPropertySymbols,uT=Object.getPrototypeOf,sm=Object.prototype.hasOwnProperty,uj=Object.prototype.propertyIsEnumerable,yy=(e,n,s)=>n in e?ku(e,n,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[n]=s,as=(e,n)=>{for(var s in n||(n={}))sm.call(n,s)&&yy(e,s,n[s]);if(Vc)for(var s of Vc(n))uj.call(n,s)&&yy(e,s,n[s]);return e},vu=(e,n)=>oT(e,cT(n)),dj=(e,n)=>{var s={};for(var r in e)sm.call(e,r)&&n.indexOf(r)<0&&(s[r]=e[r]);if(e!=null&&Vc)for(var r of Vc(e))n.indexOf(r)<0&&uj.call(e,r)&&(s[r]=e[r]);return s},dT=(e,n)=>function(){return n||(0,e[cj(e)[0]])((n={exports:{}}).exports,n),n.exports},hT=(e,n)=>{for(var s in n)ku(e,s,{get:n[s],enumerable:!0})},pT=(e,n,s,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let a of cj(n))!sm.call(e,a)&&a!==s&&ku(e,a,{get:()=>n[a],enumerable:!(r=lT(n,a))||r.enumerable});return e},fT=(e,n,s)=>(s=e!=null?aT(uT(e)):{},pT(!e||!e.__esModule?ku(s,"default",{value:e,enumerable:!0}):s,e)),mT=dT({"../../node_modules/.pnpm/prismjs@1.29.0_patch_hash=vrxx3pzkik6jpmgpayxfjunetu/node_modules/prismjs/prism.js"(e,n){var s=(function(){var r=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,a=0,o={},c={util:{encode:function k(v){return v instanceof u?new u(v.type,k(v.content),v.alias):Array.isArray(v)?v.map(k):v.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function(k){return Object.prototype.toString.call(k).slice(8,-1)},objId:function(k){return k.__id||Object.defineProperty(k,"__id",{value:++a}),k.__id},clone:function k(v,b){b=b||{};var N,C;switch(c.util.type(v)){case"Object":if(C=c.util.objId(v),b[C])return b[C];N={},b[C]=N;for(var S in v)v.hasOwnProperty(S)&&(N[S]=k(v[S],b));return N;case"Array":return C=c.util.objId(v),b[C]?b[C]:(N=[],b[C]=N,v.forEach(function(P,M){N[M]=k(P,b)}),N);default:return v}},getLanguage:function(k){for(;k;){var v=r.exec(k.className);if(v)return v[1].toLowerCase();k=k.parentElement}return"none"},setLanguage:function(k,v){k.className=k.className.replace(RegExp(r,"gi"),""),k.classList.add("language-"+v)},isActive:function(k,v,b){for(var N="no-"+v;k;){var C=k.classList;if(C.contains(v))return!0;if(C.contains(N))return!1;k=k.parentElement}return!!b}},languages:{plain:o,plaintext:o,text:o,txt:o,extend:function(k,v){var b=c.util.clone(c.languages[k]);for(var N in v)b[N]=v[N];return b},insertBefore:function(k,v,b,N){N=N||c.languages;var C=N[k],S={};for(var P in C)if(C.hasOwnProperty(P)){if(P==v)for(var M in b)b.hasOwnProperty(M)&&(S[M]=b[M]);b.hasOwnProperty(P)||(S[P]=C[P])}var T=N[k];return N[k]=S,c.languages.DFS(c.languages,function(F,R){R===T&&F!=k&&(this[F]=S)}),S},DFS:function k(v,b,N,C){C=C||{};var S=c.util.objId;for(var P in v)if(v.hasOwnProperty(P)){b.call(v,P,v[P],N||P);var M=v[P],T=c.util.type(M);T==="Object"&&!C[S(M)]?(C[S(M)]=!0,k(M,b,null,C)):T==="Array"&&!C[S(M)]&&(C[S(M)]=!0,k(M,b,P,C))}}},plugins:{},highlight:function(k,v,b){var N={code:k,grammar:v,language:b};if(c.hooks.run("before-tokenize",N),!N.grammar)throw new Error('The language "'+N.language+'" has no grammar.');return N.tokens=c.tokenize(N.code,N.grammar),c.hooks.run("after-tokenize",N),u.stringify(c.util.encode(N.tokens),N.language)},tokenize:function(k,v){var b=v.rest;if(b){for(var N in b)v[N]=b[N];delete v.rest}var C=new f;return m(C,C.head,k),p(k,C,v,C.head,0),x(C)},hooks:{all:{},add:function(k,v){var b=c.hooks.all;b[k]=b[k]||[],b[k].push(v)},run:function(k,v){var b=c.hooks.all[k];if(!(!b||!b.length))for(var N=0,C;C=b[N++];)C(v)}},Token:u};function u(k,v,b,N){this.type=k,this.content=v,this.alias=b,this.length=(N||"").length|0}u.stringify=function k(v,b){if(typeof v=="string")return v;if(Array.isArray(v)){var N="";return v.forEach(function(T){N+=k(T,b)}),N}var C={type:v.type,content:k(v.content,b),tag:"span",classes:["token",v.type],attributes:{},language:b},S=v.alias;S&&(Array.isArray(S)?Array.prototype.push.apply(C.classes,S):C.classes.push(S)),c.hooks.run("wrap",C);var P="";for(var M in C.attributes)P+=" "+M+'="'+(C.attributes[M]||"").replace(/"/g,"&quot;")+'"';return"<"+C.tag+' class="'+C.classes.join(" ")+'"'+P+">"+C.content+"</"+C.tag+">"};function d(k,v,b,N){k.lastIndex=v;var C=k.exec(b);if(C&&N&&C[1]){var S=C[1].length;C.index+=S,C[0]=C[0].slice(S)}return C}function p(k,v,b,N,C,S){for(var P in b)if(!(!b.hasOwnProperty(P)||!b[P])){var M=b[P];M=Array.isArray(M)?M:[M];for(var T=0;T<M.length;++T){if(S&&S.cause==P+","+T)return;var F=M[T],R=F.inside,B=!!F.lookbehind,I=!!F.greedy,O=F.alias;if(I&&!F.pattern.global){var _=F.pattern.toString().match(/[imsuy]*$/)[0];F.pattern=RegExp(F.pattern.source,_+"g")}for(var Q=F.pattern||F,q=N.next,K=C;q!==v.tail&&!(S&&K>=S.reach);K+=q.value.length,q=q.next){var ce=q.value;if(v.length>k.length)return;if(!(ce instanceof u)){var H=1,V;if(I){if(V=d(Q,K,k,B),!V||V.index>=k.length)break;var ee=V.index,ne=V.index+V[0].length,A=K;for(A+=q.value.length;ee>=A;)q=q.next,A+=q.value.length;if(A-=q.value.length,K=A,q.value instanceof u)continue;for(var D=q;D!==v.tail&&(A<ne||typeof D.value=="string");D=D.next)H++,A+=D.value.length;H--,ce=k.slice(K,A),V.index-=K}else if(V=d(Q,0,ce,B),!V)continue;var ee=V.index,z=V[0],me=ce.slice(0,ee),he=ce.slice(ee+z.length),ke=K+ce.length;S&&ke>S.reach&&(S.reach=ke);var Re=q.prev;me&&(Re=m(v,Re,me),K+=me.length),y(v,Re,H);var Ae=new u(P,R?c.tokenize(z,R):z,O,z);if(q=m(v,Re,Ae),he&&m(v,q,he),H>1){var $e={cause:P+","+T,reach:ke};p(k,v,b,q.prev,K,$e),S&&$e.reach>S.reach&&(S.reach=$e.reach)}}}}}}function f(){var k={value:null,prev:null,next:null},v={value:null,prev:k,next:null};k.next=v,this.head=k,this.tail=v,this.length=0}function m(k,v,b){var N=v.next,C={value:b,prev:v,next:N};return v.next=C,N.prev=C,k.length++,C}function y(k,v,b){for(var N=v.next,C=0;C<b&&N!==k.tail;C++)N=N.next;v.next=N,N.prev=v,k.length-=C}function x(k){for(var v=[],b=k.head.next;b!==k.tail;)v.push(b.value),b=b.next;return v}return c})();n.exports=s,s.default=s}}),te=fT(mT());te.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},te.languages.markup.tag.inside["attr-value"].inside.entity=te.languages.markup.entity,te.languages.markup.doctype.inside["internal-subset"].inside=te.languages.markup,te.hooks.add("wrap",function(e){e.type==="entity"&&(e.attributes.title=e.content.replace(/&amp;/,"&"))}),Object.defineProperty(te.languages.markup.tag,"addInlined",{value:function(e,r){var s={},s=(s["language-"+r]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:te.languages[r]},s.cdata=/^<!\[CDATA\[|\]\]>$/i,{"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:s}}),r=(s["language-"+r]={pattern:/[\s\S]+/,inside:te.languages[r]},{});r[e]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return e}),"i"),lookbehind:!0,greedy:!0,inside:s},te.languages.insertBefore("markup","cdata",r)}}),Object.defineProperty(te.languages.markup.tag,"addAttribute",{value:function(e,n){te.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+e+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[n,"language-"+n],inside:te.languages[n]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),te.languages.html=te.languages.markup,te.languages.mathml=te.languages.markup,te.languages.svg=te.languages.markup,te.languages.xml=te.languages.extend("markup",{}),te.languages.ssml=te.languages.xml,te.languages.atom=te.languages.xml,te.languages.rss=te.languages.xml,(function(e){var n={pattern:/\\[\\(){}[\]^$+*?|.]/,alias:"escape"},s=/\\(?:x[\da-fA-F]{2}|u[\da-fA-F]{4}|u\{[\da-fA-F]+\}|0[0-7]{0,2}|[123][0-7]{2}|c[a-zA-Z]|.)/,r="(?:[^\\\\-]|"+s.source+")",r=RegExp(r+"-"+r),a={pattern:/(<|')[^<>']+(?=[>']$)/,lookbehind:!0,alias:"variable"};e.languages.regex={"char-class":{pattern:/((?:^|[^\\])(?:\\\\)*)\[(?:[^\\\]]|\\[\s\S])*\]/,lookbehind:!0,inside:{"char-class-negation":{pattern:/(^\[)\^/,lookbehind:!0,alias:"operator"},"char-class-punctuation":{pattern:/^\[|\]$/,alias:"punctuation"},range:{pattern:r,inside:{escape:s,"range-punctuation":{pattern:/-/,alias:"operator"}}},"special-escape":n,"char-set":{pattern:/\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},escape:s}},"special-escape":n,"char-set":{pattern:/\.|\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},backreference:[{pattern:/\\(?![123][0-7]{2})[1-9]/,alias:"keyword"},{pattern:/\\k<[^<>']+>/,alias:"keyword",inside:{"group-name":a}}],anchor:{pattern:/[$^]|\\[ABbGZz]/,alias:"function"},escape:s,group:[{pattern:/\((?:\?(?:<[^<>']+>|'[^<>']+'|[>:]|<?[=!]|[idmnsuxU]+(?:-[idmnsuxU]+)?:?))?/,alias:"punctuation",inside:{"group-name":a}},{pattern:/\)/,alias:"punctuation"}],quantifier:{pattern:/(?:[+*?]|\{\d+(?:,\d*)?\})[?+]?/,alias:"number"},alternation:{pattern:/\|/,alias:"keyword"}}})(te),te.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},te.languages.javascript=te.languages.extend("clike",{"class-name":[te.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),te.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,te.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:te.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:te.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:te.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:te.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:te.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),te.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:te.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),te.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),te.languages.markup&&(te.languages.markup.tag.addInlined("script","javascript"),te.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),te.languages.js=te.languages.javascript,te.languages.actionscript=te.languages.extend("javascript",{keyword:/\b(?:as|break|case|catch|class|const|default|delete|do|dynamic|each|else|extends|final|finally|for|function|get|if|implements|import|in|include|instanceof|interface|internal|is|namespace|native|new|null|override|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|use|var|void|while|with)\b/,operator:/\+\+|--|(?:[+\-*\/%^]|&&?|\|\|?|<<?|>>?>?|[!=]=?)=?|[~?@]/}),te.languages.actionscript["class-name"].alias="function",delete te.languages.actionscript.parameter,delete te.languages.actionscript["literal-property"],te.languages.markup&&te.languages.insertBefore("actionscript","string",{xml:{pattern:/(^|[^.])<\/?\w+(?:\s+[^\s>\/=]+=("|')(?:\\[\s\S]|(?!\2)[^\\])*\2)*\s*\/?>/,lookbehind:!0,inside:te.languages.markup}}),(function(e){var n=/#(?!\{).+/,s={pattern:/#\{[^}]+\}/,alias:"variable"};e.languages.coffeescript=e.languages.extend("javascript",{comment:n,string:[{pattern:/'(?:\\[\s\S]|[^\\'])*'/,greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,greedy:!0,inside:{interpolation:s}}],keyword:/\b(?:and|break|by|catch|class|continue|debugger|delete|do|each|else|extend|extends|false|finally|for|if|in|instanceof|is|isnt|let|loop|namespace|new|no|not|null|of|off|on|or|own|return|super|switch|then|this|throw|true|try|typeof|undefined|unless|until|when|while|window|with|yes|yield)\b/,"class-member":{pattern:/@(?!\d)\w+/,alias:"variable"}}),e.languages.insertBefore("coffeescript","comment",{"multiline-comment":{pattern:/###[\s\S]+?###/,alias:"comment"},"block-regex":{pattern:/\/{3}[\s\S]*?\/{3}/,alias:"regex",inside:{comment:n,interpolation:s}}}),e.languages.insertBefore("coffeescript","string",{"inline-javascript":{pattern:/`(?:\\[\s\S]|[^\\`])*`/,inside:{delimiter:{pattern:/^`|`$/,alias:"punctuation"},script:{pattern:/[\s\S]+/,alias:"language-javascript",inside:e.languages.javascript}}},"multiline-string":[{pattern:/'''[\s\S]*?'''/,greedy:!0,alias:"string"},{pattern:/"""[\s\S]*?"""/,greedy:!0,alias:"string",inside:{interpolation:s}}]}),e.languages.insertBefore("coffeescript","keyword",{property:/(?!\d)\w+(?=\s*:(?!:))/}),delete e.languages.coffeescript["template-string"],e.languages.coffee=e.languages.coffeescript})(te),(function(e){var n=e.languages.javadoclike={parameter:{pattern:/(^[\t ]*(?:\/{3}|\*|\/\*\*)\s*@(?:arg|arguments|param)\s+)\w+/m,lookbehind:!0},keyword:{pattern:/(^[\t ]*(?:\/{3}|\*|\/\*\*)\s*|\{)@[a-z][a-zA-Z-]+\b/m,lookbehind:!0},punctuation:/[{}]/};Object.defineProperty(n,"addSupport",{value:function(s,r){(s=typeof s=="string"?[s]:s).forEach(function(a){var o=function(m){m.inside||(m.inside={}),m.inside.rest=r},c="doc-comment";if(u=e.languages[a]){var u,d=u[c];if((d=d||(u=e.languages.insertBefore(a,"comment",{"doc-comment":{pattern:/(^|[^\\])\/\*\*[^/][\s\S]*?(?:\*\/|$)/,lookbehind:!0,alias:"comment"}}))[c])instanceof RegExp&&(d=u[c]={pattern:d}),Array.isArray(d))for(var p=0,f=d.length;p<f;p++)d[p]instanceof RegExp&&(d[p]={pattern:d[p]}),o(d[p]);else o(d)}})}}),n.addSupport(["java","javascript","php"],n)})(te),(function(e){var n=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/,n=(e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+n.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+n.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+n.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+n.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:n,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css,e.languages.markup);n&&(n.tag.addInlined("style","css"),n.tag.addAttribute("style","css"))})(te),(function(e){var n=/("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,n=(e.languages.css.selector={pattern:e.languages.css.selector.pattern,lookbehind:!0,inside:n={"pseudo-element":/:(?:after|before|first-letter|first-line|selection)|::[-\w]+/,"pseudo-class":/:[-\w]+/,class:/\.[-\w]+/,id:/#[-\w]+/,attribute:{pattern:RegExp(`\\[(?:[^[\\]"']|`+n.source+")*\\]"),greedy:!0,inside:{punctuation:/^\[|\]$/,"case-sensitivity":{pattern:/(\s)[si]$/i,lookbehind:!0,alias:"keyword"},namespace:{pattern:/^(\s*)(?:(?!\s)[-*\w\xA0-\uFFFF])*\|(?!=)/,lookbehind:!0,inside:{punctuation:/\|$/}},"attr-name":{pattern:/^(\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+/,lookbehind:!0},"attr-value":[n,{pattern:/(=\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+(?=\s*$)/,lookbehind:!0}],operator:/[|~*^$]?=/}},"n-th":[{pattern:/(\(\s*)[+-]?\d*[\dn](?:\s*[+-]\s*\d+)?(?=\s*\))/,lookbehind:!0,inside:{number:/[\dn]+/,operator:/[+-]/}},{pattern:/(\(\s*)(?:even|odd)(?=\s*\))/i,lookbehind:!0}],combinator:/>|\+|~|\|\|/,punctuation:/[(),]/}},e.languages.css.atrule.inside["selector-function-argument"].inside=n,e.languages.insertBefore("css","property",{variable:{pattern:/(^|[^-\w\xA0-\uFFFF])--(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*/i,lookbehind:!0}}),{pattern:/(\b\d+)(?:%|[a-z]+(?![\w-]))/,lookbehind:!0}),s={pattern:/(^|[^\w.-])-?(?:\d+(?:\.\d+)?|\.\d+)/,lookbehind:!0};e.languages.insertBefore("css","function",{operator:{pattern:/(\s)[+\-*\/](?=\s)/,lookbehind:!0},hexcode:{pattern:/\B#[\da-f]{3,8}\b/i,alias:"color"},color:[{pattern:/(^|[^\w-])(?:AliceBlue|AntiqueWhite|Aqua|Aquamarine|Azure|Beige|Bisque|Black|BlanchedAlmond|Blue|BlueViolet|Brown|BurlyWood|CadetBlue|Chartreuse|Chocolate|Coral|CornflowerBlue|Cornsilk|Crimson|Cyan|DarkBlue|DarkCyan|DarkGoldenRod|DarkGr[ae]y|DarkGreen|DarkKhaki|DarkMagenta|DarkOliveGreen|DarkOrange|DarkOrchid|DarkRed|DarkSalmon|DarkSeaGreen|DarkSlateBlue|DarkSlateGr[ae]y|DarkTurquoise|DarkViolet|DeepPink|DeepSkyBlue|DimGr[ae]y|DodgerBlue|FireBrick|FloralWhite|ForestGreen|Fuchsia|Gainsboro|GhostWhite|Gold|GoldenRod|Gr[ae]y|Green|GreenYellow|HoneyDew|HotPink|IndianRed|Indigo|Ivory|Khaki|Lavender|LavenderBlush|LawnGreen|LemonChiffon|LightBlue|LightCoral|LightCyan|LightGoldenRodYellow|LightGr[ae]y|LightGreen|LightPink|LightSalmon|LightSeaGreen|LightSkyBlue|LightSlateGr[ae]y|LightSteelBlue|LightYellow|Lime|LimeGreen|Linen|Magenta|Maroon|MediumAquaMarine|MediumBlue|MediumOrchid|MediumPurple|MediumSeaGreen|MediumSlateBlue|MediumSpringGreen|MediumTurquoise|MediumVioletRed|MidnightBlue|MintCream|MistyRose|Moccasin|NavajoWhite|Navy|OldLace|Olive|OliveDrab|Orange|OrangeRed|Orchid|PaleGoldenRod|PaleGreen|PaleTurquoise|PaleVioletRed|PapayaWhip|PeachPuff|Peru|Pink|Plum|PowderBlue|Purple|RebeccaPurple|Red|RosyBrown|RoyalBlue|SaddleBrown|Salmon|SandyBrown|SeaGreen|SeaShell|Sienna|Silver|SkyBlue|SlateBlue|SlateGr[ae]y|Snow|SpringGreen|SteelBlue|Tan|Teal|Thistle|Tomato|Transparent|Turquoise|Violet|Wheat|White|WhiteSmoke|Yellow|YellowGreen)(?![\w-])/i,lookbehind:!0},{pattern:/\b(?:hsl|rgb)\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*\)\B|\b(?:hsl|rgb)a\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*,\s*(?:0|0?\.\d+|1)\s*\)\B/i,inside:{unit:n,number:s,function:/[\w-]+(?=\()/,punctuation:/[(),]/}}],entity:/\\[\da-f]{1,8}/i,unit:n,number:s})})(te),(function(e){var n=/[*&][^\s[\]{},]+/,s=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,r="(?:"+s.source+"(?:[ ]+"+n.source+")?|"+n.source+"(?:[ ]+"+s.source+")?)",a=/(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-]<PLAIN>)(?:[ \t]*(?:(?![#:])<PLAIN>|:<PLAIN>))*/.source.replace(/<PLAIN>/g,function(){return/[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source}),o=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function c(u,d){d=(d||"").replace(/m/g,"")+"m";var p=/([:\-,[{]\s*(?:\s<<prop>>[ \t]+)?)(?:<<value>>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<<prop>>/g,function(){return r}).replace(/<<value>>/g,function(){return u});return RegExp(p,d)}e.languages.yaml={scalar:{pattern:RegExp(/([\-:]\s*(?:\s<<prop>>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<<prop>>/g,function(){return r})),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<<prop>>[ \t]+)?)<<key>>(?=\s*:\s)/.source.replace(/<<prop>>/g,function(){return r}).replace(/<<key>>/g,function(){return"(?:"+a+"|"+o+")"})),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:c(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),lookbehind:!0,alias:"number"},boolean:{pattern:c(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:c(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:c(o),lookbehind:!0,greedy:!0},number:{pattern:c(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,"i"),lookbehind:!0},tag:s,important:n,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},e.languages.yml=e.languages.yaml})(te),(function(e){var n=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function s(p){return p=p.replace(/<inner>/g,function(){return n}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+p+")")}var r=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,a=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return r}),o=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source,c=(e.languages.markdown=e.languages.extend("markup",{}),e.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:e.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+a+o+"(?:"+a+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+a+o+")(?:"+a+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(r),inside:e.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+a+")"+o+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+a+"$"),inside:{"table-header":{pattern:RegExp(r),alias:"important",inside:e.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:s(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:s(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:s(/(~~?)(?:(?!~)<inner>)+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:s(/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach(function(p){["url","bold","italic","strike","code-snippet"].forEach(function(f){p!==f&&(e.languages.markdown[p].inside.content.inside[f]=e.languages.markdown[f])})}),e.hooks.add("after-tokenize",function(p){p.language!=="markdown"&&p.language!=="md"||(function f(m){if(m&&typeof m!="string")for(var y=0,x=m.length;y<x;y++){var k,v=m[y];v.type!=="code"?f(v.content):(k=v.content[1],v=v.content[3],k&&v&&k.type==="code-language"&&v.type==="code-block"&&typeof k.content=="string"&&(k=k.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp"),k="language-"+(k=(/[a-z][\w-]*/i.exec(k)||[""])[0].toLowerCase()),v.alias?typeof v.alias=="string"?v.alias=[v.alias,k]:v.alias.push(k):v.alias=[k]))}})(p.tokens)}),e.hooks.add("wrap",function(p){if(p.type==="code-block"){for(var f="",m=0,y=p.classes.length;m<y;m++){var x=p.classes[m],x=/language-(.+)/.exec(x);if(x){f=x[1];break}}var k,v=e.languages[f];v?p.content=e.highlight((function(b){return b=b.replace(c,""),b=b.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,function(N,C){var S;return(C=C.toLowerCase())[0]==="#"?(S=C[1]==="x"?parseInt(C.slice(2),16):Number(C.slice(1)),d(S)):u[C]||N})})(p.content),v,f):f&&f!=="none"&&e.plugins.autoloader&&(k="md-"+new Date().valueOf()+"-"+Math.floor(1e16*Math.random()),p.attributes.id=k,e.plugins.autoloader.loadLanguages(f,function(){var b=document.getElementById(k);b&&(b.innerHTML=e.highlight(b.textContent,e.languages[f],f))}))}}),RegExp(e.languages.markup.tag.pattern.source,"gi")),u={amp:"&",lt:"<",gt:">",quot:'"'},d=String.fromCodePoint||String.fromCharCode;e.languages.md=e.languages.markdown})(te),te.languages.graphql={comment:/#.*/,description:{pattern:/(?:"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*")(?=\s*[a-z_])/i,greedy:!0,alias:"string",inside:{"language-markdown":{pattern:/(^"(?:"")?)(?!\1)[\s\S]+(?=\1$)/,lookbehind:!0,inside:te.languages.markdown}}},string:{pattern:/"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*"/,greedy:!0},number:/(?:\B-|\b)\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,boolean:/\b(?:false|true)\b/,variable:/\$[a-z_]\w*/i,directive:{pattern:/@[a-z_]\w*/i,alias:"function"},"attr-name":{pattern:/\b[a-z_]\w*(?=\s*(?:\((?:[^()"]|"(?:\\.|[^\\"\r\n])*")*\))?:)/i,greedy:!0},"atom-input":{pattern:/\b[A-Z]\w*Input\b/,alias:"class-name"},scalar:/\b(?:Boolean|Float|ID|Int|String)\b/,constant:/\b[A-Z][A-Z_\d]*\b/,"class-name":{pattern:/(\b(?:enum|implements|interface|on|scalar|type|union)\s+|&\s*|:\s*|\[)[A-Z_]\w*/,lookbehind:!0},fragment:{pattern:/(\bfragment\s+|\.{3}\s*(?!on\b))[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-mutation":{pattern:/(\bmutation\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-query":{pattern:/(\bquery\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},keyword:/\b(?:directive|enum|extend|fragment|implements|input|interface|mutation|on|query|repeatable|scalar|schema|subscription|type|union)\b/,operator:/[!=|&]|\.{3}/,"property-query":/\w+(?=\s*\()/,object:/\w+(?=\s*\{)/,punctuation:/[!(){}\[\]:=,]/,property:/\w+/},te.hooks.add("after-tokenize",function(e){if(e.language==="graphql")for(var n=e.tokens.filter(function(k){return typeof k!="string"&&k.type!=="comment"&&k.type!=="scalar"}),s=0;s<n.length;){var r=n[s++];if(r.type==="keyword"&&r.content==="mutation"){var a=[];if(m(["definition-mutation","punctuation"])&&f(1).content==="("){s+=2;var o=y(/^\($/,/^\)$/);if(o===-1)continue;for(;s<o;s++){var c=f(0);c.type==="variable"&&(x(c,"variable-input"),a.push(c.content))}s=o+1}if(m(["punctuation","property-query"])&&f(0).content==="{"&&(s++,x(f(0),"property-mutation"),0<a.length)){var u=y(/^\{$/,/^\}$/);if(u!==-1)for(var d=s;d<u;d++){var p=n[d];p.type==="variable"&&0<=a.indexOf(p.content)&&x(p,"variable-input")}}}}function f(k){return n[s+k]}function m(k,v){v=v||0;for(var b=0;b<k.length;b++){var N=f(b+v);if(!N||N.type!==k[b])return}return 1}function y(k,v){for(var b=1,N=s;N<n.length;N++){var C=n[N],S=C.content;if(C.type==="punctuation"&&typeof S=="string"){if(k.test(S))b++;else if(v.test(S)&&--b===0)return N}}return-1}function x(k,v){var b=k.alias;b?Array.isArray(b)||(k.alias=b=[b]):k.alias=b=[],b.push(v)}}),te.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/},(function(e){var n=e.languages.javascript["template-string"],s=n.pattern.source,r=n.inside.interpolation,a=r.inside["interpolation-punctuation"],o=r.pattern.source;function c(m,y){if(e.languages[m])return{pattern:RegExp("((?:"+y+")\\s*)"+s),lookbehind:!0,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},"embedded-code":{pattern:/[\s\S]+/,alias:m}}}}function u(m,y,x){return m={code:m,grammar:y,language:x},e.hooks.run("before-tokenize",m),m.tokens=e.tokenize(m.code,m.grammar),e.hooks.run("after-tokenize",m),m.tokens}function d(m,y,x){var b=e.tokenize(m,{interpolation:{pattern:RegExp(o),lookbehind:!0}}),k=0,v={},b=u(b.map(function(C){if(typeof C=="string")return C;for(var S,P,C=C.content;m.indexOf((P=k++,S="___"+x.toUpperCase()+"_"+P+"___"))!==-1;);return v[S]=C,S}).join(""),y,x),N=Object.keys(v);return k=0,(function C(S){for(var P=0;P<S.length;P++){if(k>=N.length)return;var M,T,F,R,B,I,O,_=S[P];typeof _=="string"||typeof _.content=="string"?(M=N[k],(O=(I=typeof _=="string"?_:_.content).indexOf(M))!==-1&&(++k,T=I.substring(0,O),B=v[M],F=void 0,(R={})["interpolation-punctuation"]=a,(R=e.tokenize(B,R)).length===3&&((F=[1,1]).push.apply(F,u(R[1],e.languages.javascript,"javascript")),R.splice.apply(R,F)),F=new e.Token("interpolation",R,r.alias,B),R=I.substring(O+M.length),B=[],T&&B.push(T),B.push(F),R&&(C(I=[R]),B.push.apply(B,I)),typeof _=="string"?(S.splice.apply(S,[P,1].concat(B)),P+=B.length-1):_.content=B)):(O=_.content,Array.isArray(O)?C(O):C([O]))}})(b),new e.Token(x,b,"language-"+x,m)}e.languages.javascript["template-string"]=[c("css",/\b(?:styled(?:\([^)]*\))?(?:\s*\.\s*\w+(?:\([^)]*\))*)*|css(?:\s*\.\s*(?:global|resolve))?|createGlobalStyle|keyframes)/.source),c("html",/\bhtml|\.\s*(?:inner|outer)HTML\s*\+?=/.source),c("svg",/\bsvg/.source),c("markdown",/\b(?:markdown|md)/.source),c("graphql",/\b(?:gql|graphql(?:\s*\.\s*experimental)?)/.source),c("sql",/\bsql/.source),n].filter(Boolean);var p={javascript:!0,js:!0,typescript:!0,ts:!0,jsx:!0,tsx:!0};function f(m){return typeof m=="string"?m:Array.isArray(m)?m.map(f).join(""):f(m.content)}e.hooks.add("after-tokenize",function(m){m.language in p&&(function y(x){for(var k=0,v=x.length;k<v;k++){var b,N,C,S=x[k];typeof S!="string"&&(b=S.content,Array.isArray(b)?S.type==="template-string"?(S=b[1],b.length===3&&typeof S!="string"&&S.type==="embedded-code"&&(N=f(S),S=S.alias,S=Array.isArray(S)?S[0]:S,C=e.languages[S])&&(b[1]=d(N,C,S))):y(b):typeof b!="string"&&y([b]))}})(m.tokens)})})(te),(function(e){e.languages.typescript=e.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),e.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete e.languages.typescript.parameter,delete e.languages.typescript["literal-property"];var n=e.languages.extend("typescript",{});delete n["class-name"],e.languages.typescript["class-name"].inside=n,e.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:n}}}}),e.languages.ts=e.languages.typescript})(te),(function(e){var n=e.languages.javascript,s=/\{(?:[^{}]|\{(?:[^{}]|\{[^{}]*\})*\})+\}/.source,r="(@(?:arg|argument|param|property)\\s+(?:"+s+"\\s+)?)";e.languages.jsdoc=e.languages.extend("javadoclike",{parameter:{pattern:RegExp(r+/(?:(?!\s)[$\w\xA0-\uFFFF.])+(?=\s|$)/.source),lookbehind:!0,inside:{punctuation:/\./}}}),e.languages.insertBefore("jsdoc","keyword",{"optional-parameter":{pattern:RegExp(r+/\[(?:(?!\s)[$\w\xA0-\uFFFF.])+(?:=[^[\]]+)?\](?=\s|$)/.source),lookbehind:!0,inside:{parameter:{pattern:/(^\[)[$\w\xA0-\uFFFF\.]+/,lookbehind:!0,inside:{punctuation:/\./}},code:{pattern:/(=)[\s\S]*(?=\]$)/,lookbehind:!0,inside:n,alias:"language-javascript"},punctuation:/[=[\]]/}},"class-name":[{pattern:RegExp(/(@(?:augments|class|extends|interface|memberof!?|template|this|typedef)\s+(?:<TYPE>\s+)?)[A-Z]\w*(?:\.[A-Z]\w*)*/.source.replace(/<TYPE>/g,function(){return s})),lookbehind:!0,inside:{punctuation:/\./}},{pattern:RegExp("(@[a-z]+\\s+)"+s),lookbehind:!0,inside:{string:n.string,number:n.number,boolean:n.boolean,keyword:e.languages.typescript.keyword,operator:/=>|\.\.\.|[&|?:*]/,punctuation:/[.,;=<>{}()[\]]/}}],example:{pattern:/(@example\s+(?!\s))(?:[^@\s]|\s+(?!\s))+?(?=\s*(?:\*\s*)?(?:@\w|\*\/))/,lookbehind:!0,inside:{code:{pattern:/^([\t ]*(?:\*\s*)?)\S.*$/m,lookbehind:!0,inside:n,alias:"language-javascript"}}}}),e.languages.javadoclike.addSupport("javascript",e.languages.jsdoc)})(te),(function(e){e.languages.flow=e.languages.extend("javascript",{}),e.languages.insertBefore("flow","keyword",{type:[{pattern:/\b(?:[Bb]oolean|Function|[Nn]umber|[Ss]tring|[Ss]ymbol|any|mixed|null|void)\b/,alias:"class-name"}]}),e.languages.flow["function-variable"].pattern=/(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=\s*(?:function\b|(?:\([^()]*\)(?:\s*:\s*\w+)?|(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/i,delete e.languages.flow.parameter,e.languages.insertBefore("flow","operator",{"flow-punctuation":{pattern:/\{\||\|\}/,alias:"punctuation"}}),Array.isArray(e.languages.flow.keyword)||(e.languages.flow.keyword=[e.languages.flow.keyword]),e.languages.flow.keyword.unshift({pattern:/(^|[^$]\b)(?:Class|declare|opaque|type)\b(?!\$)/,lookbehind:!0},{pattern:/(^|[^$]\B)\$(?:Diff|Enum|Exact|Keys|ObjMap|PropertyType|Record|Shape|Subtype|Supertype|await)\b(?!\$)/,lookbehind:!0})})(te),te.languages.n4js=te.languages.extend("javascript",{keyword:/\b(?:Array|any|boolean|break|case|catch|class|const|constructor|continue|debugger|declare|default|delete|do|else|enum|export|extends|false|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|module|new|null|number|package|private|protected|public|return|set|static|string|super|switch|this|throw|true|try|typeof|var|void|while|with|yield)\b/}),te.languages.insertBefore("n4js","constant",{annotation:{pattern:/@+\w+/,alias:"operator"}}),te.languages.n4jsd=te.languages.n4js,(function(e){function n(c,u){return RegExp(c.replace(/<ID>/g,function(){return/(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/.source}),u)}e.languages.insertBefore("javascript","function-variable",{"method-variable":{pattern:RegExp("(\\.\\s*)"+e.languages.javascript["function-variable"].pattern.source),lookbehind:!0,alias:["function-variable","method","function","property-access"]}}),e.languages.insertBefore("javascript","function",{method:{pattern:RegExp("(\\.\\s*)"+e.languages.javascript.function.source),lookbehind:!0,alias:["function","property-access"]}}),e.languages.insertBefore("javascript","constant",{"known-class-name":[{pattern:/\b(?:(?:Float(?:32|64)|(?:Int|Uint)(?:8|16|32)|Uint8Clamped)?Array|ArrayBuffer|BigInt|Boolean|DataView|Date|Error|Function|Intl|JSON|(?:Weak)?(?:Map|Set)|Math|Number|Object|Promise|Proxy|Reflect|RegExp|String|Symbol|WebAssembly)\b/,alias:"class-name"},{pattern:/\b(?:[A-Z]\w*)Error\b/,alias:"class-name"}]}),e.languages.insertBefore("javascript","keyword",{imports:{pattern:n(/(\bimport\b\s*)(?:<ID>(?:\s*,\s*(?:\*\s*as\s+<ID>|\{[^{}]*\}))?|\*\s*as\s+<ID>|\{[^{}]*\})(?=\s*\bfrom\b)/.source),lookbehind:!0,inside:e.languages.javascript},exports:{pattern:n(/(\bexport\b\s*)(?:\*(?:\s*as\s+<ID>)?(?=\s*\bfrom\b)|\{[^{}]*\})/.source),lookbehind:!0,inside:e.languages.javascript}}),e.languages.javascript.keyword.unshift({pattern:/\b(?:as|default|export|from|import)\b/,alias:"module"},{pattern:/\b(?:await|break|catch|continue|do|else|finally|for|if|return|switch|throw|try|while|yield)\b/,alias:"control-flow"},{pattern:/\bnull\b/,alias:["null","nil"]},{pattern:/\bundefined\b/,alias:"nil"}),e.languages.insertBefore("javascript","operator",{spread:{pattern:/\.{3}/,alias:"operator"},arrow:{pattern:/=>/,alias:"operator"}}),e.languages.insertBefore("javascript","punctuation",{"property-access":{pattern:n(/(\.\s*)#?<ID>/.source),lookbehind:!0},"maybe-class-name":{pattern:/(^|[^$\w\xA0-\uFFFF])[A-Z][$\w\xA0-\uFFFF]+/,lookbehind:!0},dom:{pattern:/\b(?:document|(?:local|session)Storage|location|navigator|performance|window)\b/,alias:"variable"},console:{pattern:/\bconsole(?=\s*\.)/,alias:"class-name"}});for(var s=["function","function-variable","method","method-variable","property-access"],r=0;r<s.length;r++){var o=s[r],a=e.languages.javascript[o],o=(a=e.util.type(a)==="RegExp"?e.languages.javascript[o]={pattern:a}:a).inside||{};(a.inside=o)["maybe-class-name"]=/^[A-Z][\s\S]*/}})(te),(function(e){var n=e.util.clone(e.languages.javascript),s=/(?:\s|\/\/.*(?!.)|\/\*(?:[^*]|\*(?!\/))\*\/)/.source,r=/(?:\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])*\})/.source,a=/(?:\{<S>*\.{3}(?:[^{}]|<BRACES>)*\})/.source;function o(d,p){return d=d.replace(/<S>/g,function(){return s}).replace(/<BRACES>/g,function(){return r}).replace(/<SPREAD>/g,function(){return a}),RegExp(d,p)}a=o(a).source,e.languages.jsx=e.languages.extend("markup",n),e.languages.jsx.tag.pattern=o(/<\/?(?:[\w.:-]+(?:<S>+(?:[\w.:$-]+(?:=(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s{'"/>=]+|<BRACES>))?|<SPREAD>))*<S>*\/?)?>/.source),e.languages.jsx.tag.inside.tag.pattern=/^<\/?[^\s>\/]*/,e.languages.jsx.tag.inside["attr-value"].pattern=/=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/,e.languages.jsx.tag.inside.tag.inside["class-name"]=/^[A-Z]\w*(?:\.[A-Z]\w*)*$/,e.languages.jsx.tag.inside.comment=n.comment,e.languages.insertBefore("inside","attr-name",{spread:{pattern:o(/<SPREAD>/.source),inside:e.languages.jsx}},e.languages.jsx.tag),e.languages.insertBefore("inside","special-attr",{script:{pattern:o(/=<BRACES>/.source),alias:"language-javascript",inside:{"script-punctuation":{pattern:/^=(?=\{)/,alias:"punctuation"},rest:e.languages.jsx}}},e.languages.jsx.tag);function c(d){for(var p=[],f=0;f<d.length;f++){var m=d[f],y=!1;typeof m!="string"&&(m.type==="tag"&&m.content[0]&&m.content[0].type==="tag"?m.content[0].content[0].content==="</"?0<p.length&&p[p.length-1].tagName===u(m.content[0].content[1])&&p.pop():m.content[m.content.length-1].content!=="/>"&&p.push({tagName:u(m.content[0].content[1]),openedBraces:0}):0<p.length&&m.type==="punctuation"&&m.content==="{"?p[p.length-1].openedBraces++:0<p.length&&0<p[p.length-1].openedBraces&&m.type==="punctuation"&&m.content==="}"?p[p.length-1].openedBraces--:y=!0),(y||typeof m=="string")&&0<p.length&&p[p.length-1].openedBraces===0&&(y=u(m),f<d.length-1&&(typeof d[f+1]=="string"||d[f+1].type==="plain-text")&&(y+=u(d[f+1]),d.splice(f+1,1)),0<f&&(typeof d[f-1]=="string"||d[f-1].type==="plain-text")&&(y=u(d[f-1])+y,d.splice(f-1,1),f--),d[f]=new e.Token("plain-text",y,null,y)),m.content&&typeof m.content!="string"&&c(m.content)}}var u=function(d){return d?typeof d=="string"?d:typeof d.content=="string"?d.content:d.content.map(u).join(""):""};e.hooks.add("after-tokenize",function(d){d.language!=="jsx"&&d.language!=="tsx"||c(d.tokens)})})(te),(function(e){var n=e.util.clone(e.languages.typescript),n=(e.languages.tsx=e.languages.extend("jsx",n),delete e.languages.tsx.parameter,delete e.languages.tsx["literal-property"],e.languages.tsx.tag);n.pattern=RegExp(/(^|[^\w$]|(?=<\/))/.source+"(?:"+n.pattern.source+")",n.pattern.flags),n.lookbehind=!0})(te),te.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(/(^|[^"#])/.source+"(?:"+/"(?:\\(?:\((?:[^()]|\([^()]*\))*\)|\r\n|[^(])|[^\\\r\n"])*"/.source+"|"+/"""(?:\\(?:\((?:[^()]|\([^()]*\))*\)|[^(])|[^\\"]|"(?!""))*"""/.source+")"+/(?!["#])/.source),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:"punctuation"},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(/(^|[^"#])(#+)/.source+"(?:"+/"(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|\r\n|[^#])|[^\\\r\n])*?"/.source+"|"+/"""(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|[^#])|[^\\])*?"""/.source+")\\2"),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:"punctuation"},string:/[\s\S]+/}}],directive:{pattern:RegExp(/#/.source+"(?:"+/(?:elseif|if)\b/.source+"(?:[ ]*"+/(?:![ \t]*)?(?:\b\w+\b(?:[ \t]*\((?:[^()]|\([^()]*\))*\))?|\((?:[^()]|\([^()]*\))*\))(?:[ \t]*(?:&&|\|\|))?/.source+")+|"+/(?:else|endif)\b/.source+")"),alias:"property",inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:"constant"},"other-directive":{pattern:/#\w+\b/,alias:"property"},attribute:{pattern:/@\w+/,alias:"atrule"},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:"function"},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:"important"},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:"constant"},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:"keyword"},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/},te.languages.swift["string-literal"].forEach(function(e){e.inside.interpolation.inside=te.languages.swift}),(function(e){e.languages.kotlin=e.languages.extend("clike",{keyword:{pattern:/(^|[^.])\b(?:abstract|actual|annotation|as|break|by|catch|class|companion|const|constructor|continue|crossinline|data|do|dynamic|else|enum|expect|external|final|finally|for|fun|get|if|import|in|infix|init|inline|inner|interface|internal|is|lateinit|noinline|null|object|open|operator|out|override|package|private|protected|public|reified|return|sealed|set|super|suspend|tailrec|this|throw|to|try|typealias|val|var|vararg|when|where|while)\b/,lookbehind:!0},function:[{pattern:/(?:`[^\r\n`]+`|\b\w+)(?=\s*\()/,greedy:!0},{pattern:/(\.)(?:`[^\r\n`]+`|\w+)(?=\s*\{)/,lookbehind:!0,greedy:!0}],number:/\b(?:0[xX][\da-fA-F]+(?:_[\da-fA-F]+)*|0[bB][01]+(?:_[01]+)*|\d+(?:_\d+)*(?:\.\d+(?:_\d+)*)?(?:[eE][+-]?\d+(?:_\d+)*)?[fFL]?)\b/,operator:/\+[+=]?|-[-=>]?|==?=?|!(?:!|==?)?|[\/*%<>]=?|[?:]:?|\.\.|&&|\|\||\b(?:and|inv|or|shl|shr|ushr|xor)\b/}),delete e.languages.kotlin["class-name"];var n={"interpolation-punctuation":{pattern:/^\$\{?|\}$/,alias:"punctuation"},expression:{pattern:/[\s\S]+/,inside:e.languages.kotlin}};e.languages.insertBefore("kotlin","string",{"string-literal":[{pattern:/"""(?:[^$]|\$(?:(?!\{)|\{[^{}]*\}))*?"""/,alias:"multiline",inside:{interpolation:{pattern:/\$(?:[a-z_]\w*|\{[^{}]*\})/i,inside:n},string:/[\s\S]+/}},{pattern:/"(?:[^"\\\r\n$]|\\.|\$(?:(?!\{)|\{[^{}]*\}))*"/,alias:"singleline",inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:[a-z_]\w*|\{[^{}]*\})/i,lookbehind:!0,inside:n},string:/[\s\S]+/}}],char:{pattern:/'(?:[^'\\\r\n]|\\(?:.|u[a-fA-F0-9]{0,4}))'/,greedy:!0}}),delete e.languages.kotlin.string,e.languages.insertBefore("kotlin","keyword",{annotation:{pattern:/\B@(?:\w+:)?(?:[A-Z]\w*|\[[^\]]+\])/,alias:"builtin"}}),e.languages.insertBefore("kotlin","function",{label:{pattern:/\b\w+@|@\w+\b/,alias:"symbol"}}),e.languages.kt=e.languages.kotlin,e.languages.kts=e.languages.kotlin})(te),te.languages.c=te.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),te.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),te.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},te.languages.c.string],char:te.languages.c.char,comment:te.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:te.languages.c}}}}),te.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete te.languages.c.boolean,te.languages.objectivec=te.languages.extend("c",{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete te.languages.objectivec["class-name"],te.languages.objc=te.languages.objectivec,te.languages.reason=te.languages.extend("clike",{string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^\\\r\n"])*"/,greedy:!0},"class-name":/\b[A-Z]\w*/,keyword:/\b(?:and|as|assert|begin|class|constraint|do|done|downto|else|end|exception|external|for|fun|function|functor|if|in|include|inherit|initializer|lazy|let|method|module|mutable|new|nonrec|object|of|open|or|private|rec|sig|struct|switch|then|to|try|type|val|virtual|when|while|with)\b/,operator:/\.{3}|:[:=]|\|>|->|=(?:==?|>)?|<=?|>=?|[|^?'#!~`]|[+\-*\/]\.?|\b(?:asr|land|lor|lsl|lsr|lxor|mod)\b/}),te.languages.insertBefore("reason","class-name",{char:{pattern:/'(?:\\x[\da-f]{2}|\\o[0-3][0-7][0-7]|\\\d{3}|\\.|[^'\\\r\n])'/,greedy:!0},constructor:/\b[A-Z]\w*\b(?!\s*\.)/,label:{pattern:/\b[a-z]\w*(?=::)/,alias:"symbol"}}),delete te.languages.reason.function,(function(e){for(var n=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source,s=0;s<2;s++)n=n.replace(/<self>/g,function(){return n});n=n.replace(/<self>/g,function(){return/[^\s\S]/.source}),e.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+n),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},e.languages.rust["closure-params"].inside.rest=e.languages.rust,e.languages.rust.attribute.inside.string=e.languages.rust.string})(te),te.languages.go=te.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/}),te.languages.insertBefore("go","string",{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete te.languages.go["class-name"],(function(e){var n=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,s=/\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g,function(){return n.source});e.languages.cpp=e.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g,function(){return n.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:n,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),e.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(/<mod-name>/g,function(){return s})+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),e.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:e.languages.cpp}}}}),e.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),e.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:e.languages.extend("cpp",{})}}),e.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},e.languages.cpp["base-clause"])})(te),te.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},te.languages.python["string-interpolation"].inside.interpolation.inside.rest=te.languages.python,te.languages.py=te.languages.python,te.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},te.languages.webmanifest=te.languages.json;var fo={};hT(fo,{dracula:()=>xT,duotoneDark:()=>kT,duotoneLight:()=>jT,github:()=>wT,gruvboxMaterialDark:()=>XT,gruvboxMaterialLight:()=>eA,jettwaveDark:()=>UT,jettwaveLight:()=>VT,nightOwl:()=>ST,nightOwlLight:()=>$T,oceanicNext:()=>TT,okaidia:()=>PT,oneDark:()=>YT,oneLight:()=>GT,palenight:()=>IT,shadesOfPurple:()=>MT,synthwave84:()=>LT,ultramin:()=>OT,vsDark:()=>hj,vsLight:()=>BT});var gT={plain:{color:"#F8F8F2",backgroundColor:"#282A36"},styles:[{types:["prolog","constant","builtin"],style:{color:"rgb(189, 147, 249)"}},{types:["inserted","function"],style:{color:"rgb(80, 250, 123)"}},{types:["deleted"],style:{color:"rgb(255, 85, 85)"}},{types:["changed"],style:{color:"rgb(255, 184, 108)"}},{types:["punctuation","symbol"],style:{color:"rgb(248, 248, 242)"}},{types:["string","char","tag","selector"],style:{color:"rgb(255, 121, 198)"}},{types:["keyword","variable"],style:{color:"rgb(189, 147, 249)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(98, 114, 164)"}},{types:["attr-name"],style:{color:"rgb(241, 250, 140)"}}]},xT=gT,yT={plain:{backgroundColor:"#2a2734",color:"#9a86fd"},styles:[{types:["comment","prolog","doctype","cdata","punctuation"],style:{color:"#6c6783"}},{types:["namespace"],style:{opacity:.7}},{types:["tag","operator","number"],style:{color:"#e09142"}},{types:["property","function"],style:{color:"#9a86fd"}},{types:["tag-id","selector","atrule-id"],style:{color:"#eeebff"}},{types:["attr-name"],style:{color:"#c4b9fe"}},{types:["boolean","string","entity","url","attr-value","keyword","control","directive","unit","statement","regex","atrule","placeholder","variable"],style:{color:"#ffcc99"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"#c4b9fe"}}]},kT=yT,vT={plain:{backgroundColor:"#faf8f5",color:"#728fcb"},styles:[{types:["comment","prolog","doctype","cdata","punctuation"],style:{color:"#b6ad9a"}},{types:["namespace"],style:{opacity:.7}},{types:["tag","operator","number"],style:{color:"#063289"}},{types:["property","function"],style:{color:"#b29762"}},{types:["tag-id","selector","atrule-id"],style:{color:"#2d2006"}},{types:["attr-name"],style:{color:"#896724"}},{types:["boolean","string","entity","url","attr-value","keyword","control","directive","unit","statement","regex","atrule"],style:{color:"#728fcb"}},{types:["placeholder","variable"],style:{color:"#93abdc"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"#896724"}}]},jT=vT,bT={plain:{color:"#393A34",backgroundColor:"#f6f8fa"},styles:[{types:["comment","prolog","doctype","cdata"],style:{color:"#999988",fontStyle:"italic"}},{types:["namespace"],style:{opacity:.7}},{types:["string","attr-value"],style:{color:"#e3116c"}},{types:["punctuation","operator"],style:{color:"#393A34"}},{types:["entity","url","symbol","number","boolean","variable","constant","property","regex","inserted"],style:{color:"#36acaa"}},{types:["atrule","keyword","attr-name","selector"],style:{color:"#00a4db"}},{types:["function","deleted","tag"],style:{color:"#d73a49"}},{types:["function-variable"],style:{color:"#6f42c1"}},{types:["tag","selector","keyword"],style:{color:"#00009f"}}]},wT=bT,NT={plain:{color:"#d6deeb",backgroundColor:"#011627"},styles:[{types:["changed"],style:{color:"rgb(162, 191, 252)",fontStyle:"italic"}},{types:["deleted"],style:{color:"rgba(239, 83, 80, 0.56)",fontStyle:"italic"}},{types:["inserted","attr-name"],style:{color:"rgb(173, 219, 103)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(99, 119, 119)",fontStyle:"italic"}},{types:["string","url"],style:{color:"rgb(173, 219, 103)"}},{types:["variable"],style:{color:"rgb(214, 222, 235)"}},{types:["number"],style:{color:"rgb(247, 140, 108)"}},{types:["builtin","char","constant","function"],style:{color:"rgb(130, 170, 255)"}},{types:["punctuation"],style:{color:"rgb(199, 146, 234)"}},{types:["selector","doctype"],style:{color:"rgb(199, 146, 234)",fontStyle:"italic"}},{types:["class-name"],style:{color:"rgb(255, 203, 139)"}},{types:["tag","operator","keyword"],style:{color:"rgb(127, 219, 202)"}},{types:["boolean"],style:{color:"rgb(255, 88, 116)"}},{types:["property"],style:{color:"rgb(128, 203, 196)"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)"}}]},ST=NT,CT={plain:{color:"#403f53",backgroundColor:"#FBFBFB"},styles:[{types:["changed"],style:{color:"rgb(162, 191, 252)",fontStyle:"italic"}},{types:["deleted"],style:{color:"rgba(239, 83, 80, 0.56)",fontStyle:"italic"}},{types:["inserted","attr-name"],style:{color:"rgb(72, 118, 214)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(152, 159, 177)",fontStyle:"italic"}},{types:["string","builtin","char","constant","url"],style:{color:"rgb(72, 118, 214)"}},{types:["variable"],style:{color:"rgb(201, 103, 101)"}},{types:["number"],style:{color:"rgb(170, 9, 130)"}},{types:["punctuation"],style:{color:"rgb(153, 76, 195)"}},{types:["function","selector","doctype"],style:{color:"rgb(153, 76, 195)",fontStyle:"italic"}},{types:["class-name"],style:{color:"rgb(17, 17, 17)"}},{types:["tag"],style:{color:"rgb(153, 76, 195)"}},{types:["operator","property","keyword","namespace"],style:{color:"rgb(12, 150, 155)"}},{types:["boolean"],style:{color:"rgb(188, 84, 84)"}}]},$T=CT,mn={char:"#D8DEE9",comment:"#999999",keyword:"#c5a5c5",primitive:"#5a9bcf",string:"#8dc891",variable:"#d7deea",boolean:"#ff8b50",tag:"#fc929e",function:"#79b6f2",className:"#FAC863"},ET={plain:{backgroundColor:"#282c34",color:"#ffffff"},styles:[{types:["attr-name"],style:{color:mn.keyword}},{types:["attr-value"],style:{color:mn.string}},{types:["comment","block-comment","prolog","doctype","cdata","shebang"],style:{color:mn.comment}},{types:["property","number","function-name","constant","symbol","deleted"],style:{color:mn.primitive}},{types:["boolean"],style:{color:mn.boolean}},{types:["tag"],style:{color:mn.tag}},{types:["string"],style:{color:mn.string}},{types:["punctuation"],style:{color:mn.string}},{types:["selector","char","builtin","inserted"],style:{color:mn.char}},{types:["function"],style:{color:mn.function}},{types:["operator","entity","url","variable"],style:{color:mn.variable}},{types:["keyword"],style:{color:mn.keyword}},{types:["atrule","class-name"],style:{color:mn.className}},{types:["important"],style:{fontWeight:"400"}},{types:["bold"],style:{fontWeight:"bold"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["namespace"],style:{opacity:.7}}]},TT=ET,AT={plain:{color:"#f8f8f2",backgroundColor:"#272822"},styles:[{types:["changed"],style:{color:"rgb(162, 191, 252)",fontStyle:"italic"}},{types:["deleted"],style:{color:"#f92672",fontStyle:"italic"}},{types:["inserted"],style:{color:"rgb(173, 219, 103)",fontStyle:"italic"}},{types:["comment"],style:{color:"#8292a2",fontStyle:"italic"}},{types:["string","url"],style:{color:"#a6e22e"}},{types:["variable"],style:{color:"#f8f8f2"}},{types:["number"],style:{color:"#ae81ff"}},{types:["builtin","char","constant","function","class-name"],style:{color:"#e6db74"}},{types:["punctuation"],style:{color:"#f8f8f2"}},{types:["selector","doctype"],style:{color:"#a6e22e",fontStyle:"italic"}},{types:["tag","operator","keyword"],style:{color:"#66d9ef"}},{types:["boolean"],style:{color:"#ae81ff"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)",opacity:.7}},{types:["tag","property"],style:{color:"#f92672"}},{types:["attr-name"],style:{color:"#a6e22e !important"}},{types:["doctype"],style:{color:"#8292a2"}},{types:["rule"],style:{color:"#e6db74"}}]},PT=AT,RT={plain:{color:"#bfc7d5",backgroundColor:"#292d3e"},styles:[{types:["comment"],style:{color:"rgb(105, 112, 152)",fontStyle:"italic"}},{types:["string","inserted"],style:{color:"rgb(195, 232, 141)"}},{types:["number"],style:{color:"rgb(247, 140, 108)"}},{types:["builtin","char","constant","function"],style:{color:"rgb(130, 170, 255)"}},{types:["punctuation","selector"],style:{color:"rgb(199, 146, 234)"}},{types:["variable"],style:{color:"rgb(191, 199, 213)"}},{types:["class-name","attr-name"],style:{color:"rgb(255, 203, 107)"}},{types:["tag","deleted"],style:{color:"rgb(255, 85, 114)"}},{types:["operator"],style:{color:"rgb(137, 221, 255)"}},{types:["boolean"],style:{color:"rgb(255, 88, 116)"}},{types:["keyword"],style:{fontStyle:"italic"}},{types:["doctype"],style:{color:"rgb(199, 146, 234)",fontStyle:"italic"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)"}},{types:["url"],style:{color:"rgb(221, 221, 221)"}}]},IT=RT,zT={plain:{color:"#9EFEFF",backgroundColor:"#2D2A55"},styles:[{types:["changed"],style:{color:"rgb(255, 238, 128)"}},{types:["deleted"],style:{color:"rgba(239, 83, 80, 0.56)"}},{types:["inserted"],style:{color:"rgb(173, 219, 103)"}},{types:["comment"],style:{color:"rgb(179, 98, 255)",fontStyle:"italic"}},{types:["punctuation"],style:{color:"rgb(255, 255, 255)"}},{types:["constant"],style:{color:"rgb(255, 98, 140)"}},{types:["string","url"],style:{color:"rgb(165, 255, 144)"}},{types:["variable"],style:{color:"rgb(255, 238, 128)"}},{types:["number","boolean"],style:{color:"rgb(255, 98, 140)"}},{types:["attr-name"],style:{color:"rgb(255, 180, 84)"}},{types:["keyword","operator","property","namespace","tag","selector","doctype"],style:{color:"rgb(255, 157, 0)"}},{types:["builtin","char","constant","function","class-name"],style:{color:"rgb(250, 208, 0)"}}]},MT=zT,FT={plain:{backgroundColor:"linear-gradient(to bottom, #2a2139 75%, #34294f)",backgroundImage:"#34294f",color:"#f92aad",textShadow:"0 0 2px #100c0f, 0 0 5px #dc078e33, 0 0 10px #fff3"},styles:[{types:["comment","block-comment","prolog","doctype","cdata"],style:{color:"#495495",fontStyle:"italic"}},{types:["punctuation"],style:{color:"#ccc"}},{types:["tag","attr-name","namespace","number","unit","hexcode","deleted"],style:{color:"#e2777a"}},{types:["property","selector"],style:{color:"#72f1b8",textShadow:"0 0 2px #100c0f, 0 0 10px #257c5575, 0 0 35px #21272475"}},{types:["function-name"],style:{color:"#6196cc"}},{types:["boolean","selector-id","function"],style:{color:"#fdfdfd",textShadow:"0 0 2px #001716, 0 0 3px #03edf975, 0 0 5px #03edf975, 0 0 8px #03edf975"}},{types:["class-name","maybe-class-name","builtin"],style:{color:"#fff5f6",textShadow:"0 0 2px #000, 0 0 10px #fc1f2c75, 0 0 5px #fc1f2c75, 0 0 25px #fc1f2c75"}},{types:["constant","symbol"],style:{color:"#f92aad",textShadow:"0 0 2px #100c0f, 0 0 5px #dc078e33, 0 0 10px #fff3"}},{types:["important","atrule","keyword","selector-class"],style:{color:"#f4eee4",textShadow:"0 0 2px #393a33, 0 0 8px #f39f0575, 0 0 2px #f39f0575"}},{types:["string","char","attr-value","regex","variable"],style:{color:"#f87c32"}},{types:["parameter"],style:{fontStyle:"italic"}},{types:["entity","url"],style:{color:"#67cdcc"}},{types:["operator"],style:{color:"ffffffee"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["entity"],style:{cursor:"help"}},{types:["inserted"],style:{color:"green"}}]},LT=FT,_T={plain:{color:"#282a2e",backgroundColor:"#ffffff"},styles:[{types:["comment"],style:{color:"rgb(197, 200, 198)"}},{types:["string","number","builtin","variable"],style:{color:"rgb(150, 152, 150)"}},{types:["class-name","function","tag","attr-name"],style:{color:"rgb(40, 42, 46)"}}]},OT=_T,qT={plain:{color:"#9CDCFE",backgroundColor:"#1E1E1E"},styles:[{types:["prolog"],style:{color:"rgb(0, 0, 128)"}},{types:["comment"],style:{color:"rgb(106, 153, 85)"}},{types:["builtin","changed","keyword","interpolation-punctuation"],style:{color:"rgb(86, 156, 214)"}},{types:["number","inserted"],style:{color:"rgb(181, 206, 168)"}},{types:["constant"],style:{color:"rgb(100, 102, 149)"}},{types:["attr-name","variable"],style:{color:"rgb(156, 220, 254)"}},{types:["deleted","string","attr-value","template-punctuation"],style:{color:"rgb(206, 145, 120)"}},{types:["selector"],style:{color:"rgb(215, 186, 125)"}},{types:["tag"],style:{color:"rgb(78, 201, 176)"}},{types:["tag"],languages:["markup"],style:{color:"rgb(86, 156, 214)"}},{types:["punctuation","operator"],style:{color:"rgb(212, 212, 212)"}},{types:["punctuation"],languages:["markup"],style:{color:"#808080"}},{types:["function"],style:{color:"rgb(220, 220, 170)"}},{types:["class-name"],style:{color:"rgb(78, 201, 176)"}},{types:["char"],style:{color:"rgb(209, 105, 105)"}}]},hj=qT,DT={plain:{color:"#000000",backgroundColor:"#ffffff"},styles:[{types:["comment"],style:{color:"rgb(0, 128, 0)"}},{types:["builtin"],style:{color:"rgb(0, 112, 193)"}},{types:["number","variable","inserted"],style:{color:"rgb(9, 134, 88)"}},{types:["operator"],style:{color:"rgb(0, 0, 0)"}},{types:["constant","char"],style:{color:"rgb(129, 31, 63)"}},{types:["tag"],style:{color:"rgb(128, 0, 0)"}},{types:["attr-name"],style:{color:"rgb(255, 0, 0)"}},{types:["deleted","string"],style:{color:"rgb(163, 21, 21)"}},{types:["changed","punctuation"],style:{color:"rgb(4, 81, 165)"}},{types:["function","keyword"],style:{color:"rgb(0, 0, 255)"}},{types:["class-name"],style:{color:"rgb(38, 127, 153)"}}]},BT=DT,WT={plain:{color:"#f8fafc",backgroundColor:"#011627"},styles:[{types:["prolog"],style:{color:"#000080"}},{types:["comment"],style:{color:"#6A9955"}},{types:["builtin","changed","keyword","interpolation-punctuation"],style:{color:"#569CD6"}},{types:["number","inserted"],style:{color:"#B5CEA8"}},{types:["constant"],style:{color:"#f8fafc"}},{types:["attr-name","variable"],style:{color:"#9CDCFE"}},{types:["deleted","string","attr-value","template-punctuation"],style:{color:"#cbd5e1"}},{types:["selector"],style:{color:"#D7BA7D"}},{types:["tag"],style:{color:"#0ea5e9"}},{types:["tag"],languages:["markup"],style:{color:"#0ea5e9"}},{types:["punctuation","operator"],style:{color:"#D4D4D4"}},{types:["punctuation"],languages:["markup"],style:{color:"#808080"}},{types:["function"],style:{color:"#7dd3fc"}},{types:["class-name"],style:{color:"#0ea5e9"}},{types:["char"],style:{color:"#D16969"}}]},UT=WT,HT={plain:{color:"#0f172a",backgroundColor:"#f1f5f9"},styles:[{types:["prolog"],style:{color:"#000080"}},{types:["comment"],style:{color:"#6A9955"}},{types:["builtin","changed","keyword","interpolation-punctuation"],style:{color:"#0c4a6e"}},{types:["number","inserted"],style:{color:"#B5CEA8"}},{types:["constant"],style:{color:"#0f172a"}},{types:["attr-name","variable"],style:{color:"#0c4a6e"}},{types:["deleted","string","attr-value","template-punctuation"],style:{color:"#64748b"}},{types:["selector"],style:{color:"#D7BA7D"}},{types:["tag"],style:{color:"#0ea5e9"}},{types:["tag"],languages:["markup"],style:{color:"#0ea5e9"}},{types:["punctuation","operator"],style:{color:"#475569"}},{types:["punctuation"],languages:["markup"],style:{color:"#808080"}},{types:["function"],style:{color:"#0e7490"}},{types:["class-name"],style:{color:"#0ea5e9"}},{types:["char"],style:{color:"#D16969"}}]},VT=HT,KT={plain:{backgroundColor:"hsl(220, 13%, 18%)",color:"hsl(220, 14%, 71%)",textShadow:"0 1px rgba(0, 0, 0, 0.3)"},styles:[{types:["comment","prolog","cdata"],style:{color:"hsl(220, 10%, 40%)"}},{types:["doctype","punctuation","entity"],style:{color:"hsl(220, 14%, 71%)"}},{types:["attr-name","class-name","maybe-class-name","boolean","constant","number","atrule"],style:{color:"hsl(29, 54%, 61%)"}},{types:["keyword"],style:{color:"hsl(286, 60%, 67%)"}},{types:["property","tag","symbol","deleted","important"],style:{color:"hsl(355, 65%, 65%)"}},{types:["selector","string","char","builtin","inserted","regex","attr-value"],style:{color:"hsl(95, 38%, 62%)"}},{types:["variable","operator","function"],style:{color:"hsl(207, 82%, 66%)"}},{types:["url"],style:{color:"hsl(187, 47%, 55%)"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"hsl(220, 14%, 71%)"}}]},YT=KT,QT={plain:{backgroundColor:"hsl(230, 1%, 98%)",color:"hsl(230, 8%, 24%)"},styles:[{types:["comment","prolog","cdata"],style:{color:"hsl(230, 4%, 64%)"}},{types:["doctype","punctuation","entity"],style:{color:"hsl(230, 8%, 24%)"}},{types:["attr-name","class-name","boolean","constant","number","atrule"],style:{color:"hsl(35, 99%, 36%)"}},{types:["keyword"],style:{color:"hsl(301, 63%, 40%)"}},{types:["property","tag","symbol","deleted","important"],style:{color:"hsl(5, 74%, 59%)"}},{types:["selector","string","char","builtin","inserted","regex","attr-value","punctuation"],style:{color:"hsl(119, 34%, 47%)"}},{types:["variable","operator","function"],style:{color:"hsl(221, 87%, 60%)"}},{types:["url"],style:{color:"hsl(198, 99%, 37%)"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"hsl(230, 8%, 24%)"}}]},GT=QT,ZT={plain:{color:"#ebdbb2",backgroundColor:"#292828"},styles:[{types:["imports","class-name","maybe-class-name","constant","doctype","builtin","function"],style:{color:"#d8a657"}},{types:["property-access"],style:{color:"#7daea3"}},{types:["tag"],style:{color:"#e78a4e"}},{types:["attr-name","char","url","regex"],style:{color:"#a9b665"}},{types:["attr-value","string"],style:{color:"#89b482"}},{types:["comment","prolog","cdata","operator","inserted"],style:{color:"#a89984"}},{types:["delimiter","boolean","keyword","selector","important","atrule","property","variable","deleted"],style:{color:"#ea6962"}},{types:["entity","number","symbol"],style:{color:"#d3869b"}}]},XT=ZT,JT={plain:{color:"#654735",backgroundColor:"#f9f5d7"},styles:[{types:["delimiter","boolean","keyword","selector","important","atrule","property","variable","deleted"],style:{color:"#af2528"}},{types:["imports","class-name","maybe-class-name","constant","doctype","builtin"],style:{color:"#b4730e"}},{types:["string","attr-value"],style:{color:"#477a5b"}},{types:["property-access"],style:{color:"#266b79"}},{types:["function","attr-name","char","url"],style:{color:"#72761e"}},{types:["tag"],style:{color:"#b94c07"}},{types:["comment","prolog","cdata","operator","inserted"],style:{color:"#a89984"}},{types:["entity","number","symbol"],style:{color:"#924f79"}}]},eA=JT,tA=e=>$.useCallback(n=>{var s=n,{className:r,style:a,line:o}=s,c=dj(s,["className","style","line"]);const u=vu(as({},c),{className:lj("token-line",r)});return typeof e=="object"&&"plain"in e&&(u.style=e.plain),typeof a=="object"&&(u.style=as(as({},u.style||{}),a)),u},[e]),nA=e=>{const n=$.useCallback(({types:s,empty:r})=>{if(e!=null){{if(s.length===1&&s[0]==="plain")return r!=null?{display:"inline-block"}:void 0;if(s.length===1&&r!=null)return e[s[0]]}return Object.assign(r!=null?{display:"inline-block"}:{},...s.map(a=>e[a]))}},[e]);return $.useCallback(s=>{var r=s,{token:a,className:o,style:c}=r,u=dj(r,["token","className","style"]);const d=vu(as({},u),{className:lj("token",...a.types,o),children:a.content,style:n(a)});return c!=null&&(d.style=as(as({},d.style||{}),c)),d},[n])},sA=/\r\n|\r|\n/,ky=e=>{e.length===0?e.push({types:["plain"],content:`
591
- `,empty:!0}):e.length===1&&e[0].content===""&&(e[0].content=`
592
- `,e[0].empty=!0)},vy=(e,n)=>{const s=e.length;return s>0&&e[s-1]===n?e:e.concat(n)},rA=e=>{const n=[[]],s=[e],r=[0],a=[e.length];let o=0,c=0,u=[];const d=[u];for(;c>-1;){for(;(o=r[c]++)<a[c];){let p,f=n[c];const y=s[c][o];if(typeof y=="string"?(f=c>0?f:["plain"],p=y):(f=vy(f,y.type),y.alias&&(f=vy(f,y.alias)),p=y.content),typeof p!="string"){c++,n.push(f),s.push(p),r.push(0),a.push(p.length);continue}const x=p.split(sA),k=x.length;u.push({types:f,content:x[0]});for(let v=1;v<k;v++)ky(u),d.push(u=[]),u.push({types:f,content:x[v]})}c--,n.pop(),s.pop(),r.pop(),a.pop()}return ky(u),d},jy=rA,iA=({prism:e,code:n,grammar:s,language:r})=>$.useMemo(()=>{if(s==null)return jy([n]);const a={code:n,grammar:s,language:r,tokens:[]};return e.hooks.run("before-tokenize",a),a.tokens=e.tokenize(n,s),e.hooks.run("after-tokenize",a),jy(a.tokens)},[n,s,r,e]),aA=(e,n)=>{const{plain:s}=e,r=e.styles.reduce((a,o)=>{const{languages:c,style:u}=o;return c&&!c.includes(n)||o.types.forEach(d=>{const p=as(as({},a[d]),u);a[d]=p}),a},{});return r.root=s,r.plain=vu(as({},s),{backgroundColor:void 0}),r},oA=aA,lA=({children:e,language:n,code:s,theme:r,prism:a})=>{const o=n.toLowerCase(),c=oA(r,o),u=tA(c),d=nA(c),p=a.languages[o],f=iA({prism:a,language:o,code:s,grammar:p});return e({tokens:f,className:`prism-code language-${o}`,style:c!=null?c.root:{},getLineProps:u,getTokenProps:d})},pj=e=>$.createElement(lA,vu(as({},e),{prism:e.prism||te,theme:e.theme||hj,code:e.code,language:e.language}));/*! Bundled license information:
593
-
594
- prismjs/prism.js:
595
- (**
596
- * Prism: Lightweight, robust, elegant syntax highlighting
597
- *
598
- * @license MIT <https://opensource.org/licenses/MIT>
599
- * @author Lea Verou <https://lea.verou.me>
600
- * @namespace
601
- * @public
602
- *)
603
- */const cA=/^\s*(?:flowchart|graph)\s*(LR|RL|TD|TB|BT)?\s*;?\s*$/i,uA=/^([A-Za-z0-9_؀-ۿ-]+)\s*(\[\[(.+?)\]\]|\(\[(.+?)\]\)|\(\((.+?)\)\)|\[(.+?)\]|\((.+?)\)|\{(.+?)\}|>(.+?)\])?/,dA=/^\s*(-->|---|-\.->|-\.-|==>|===|--\s*(.+?)\s*-->|-\.\s*(.+?)\s*\.->|==\s*(.+?)\s*==>)\s*(?:\|(.+?)\|)?\s*/;function by(e){return e.replace(/^["']|["']$/g,"").replace(/<br\s*\/?>/gi," ").trim()}function hA(e){const n=e.split(`
604
- `).map(y=>y.replace(/%%.*$/,"").trim()).filter(Boolean),s=n.shift()?.match(cA);if(!s)return null;const r=(s[1]??"TD").toUpperCase(),a=new Map,o=[],c=y=>{const x=y.match(uA);if(!x)return null;const k=x[1],v=x[3]??x[4]??x[5]??x[6]??x[7]??x[8]??x[9],b=x[8]?"decision":x[6]||x[3]?"box":v?"round":"box",N=a.get(k);return(!N||v)&&a.set(k,{id:k,text:by(v??N?.text??k),shape:v?b:N?.shape??b}),{id:k,rest:y.slice(x[0].length)}};for(const y of n)if(!/^(classDef|class|style|linkStyle|click|subgraph|end|direction)\b/.test(y))for(const x of y.split(";").map(k=>k.trim()).filter(Boolean)){let k=c(x);if(!k)continue;let v=k.rest;for(;;){const b=v.match(dA);if(!b)break;const N=c(v.slice(b[0].length));if(!N)break;const C=by(b[5]??b[2]??b[3]??b[4]??"");o.push({from:k.id,to:N.id,...C?{label:C}:{},...b[1].includes(".")?{dashed:!0}:{}}),k=N,v=N.rest}}if(!a.size)return null;const u=new Map([...a.keys()].map(y=>[y,0]));for(let y=0;y<a.size;y+=1){let x=!1;for(const k of o){if(k.from===k.to)continue;const v=(u.get(k.from)??0)+1;v>(u.get(k.to)??0)&&v<a.size&&(u.set(k.to,v),x=!0)}if(!x)break}const d=new Map,p=[...a.values()].map(y=>{const x=u.get(y.id)??0,k=d.get(x)??0;return d.set(x,k+1),{...y,rank:x,slot:k}}),f=r==="RL"||r==="BT",m=Math.max(...p.map(y=>y.rank));return{across:r==="LR"||r==="RL",nodes:f?p.map(y=>({...y,rank:m-y.rank})):p,edges:o}}function Gr({pictures:e,start:n,onClose:s}){const[r,a]=$.useState(n),o=e.length,c=$.useCallback(d=>a(p=>(p+d+o)%o),[o]);$.useEffect(()=>{const d=p=>{p.key==="Escape"?s():p.key==="ArrowRight"?c(1):p.key==="ArrowLeft"&&c(-1)};return window.addEventListener("keydown",d),()=>window.removeEventListener("keydown",d)},[s,c]);const u=e[r];return u?t.jsxs("div",{className:"lightbox",role:"dialog","aria-modal":"true","aria-label":u.caption,onMouseDown:d=>d.target===d.currentTarget&&s(),children:[t.jsxs("div",{className:"lb-top",children:[t.jsx("span",{className:"lb-cap",children:u.caption}),o>1&&t.jsxs("span",{className:"lb-count",children:[r+1," of ",o]}),t.jsx("span",{className:"grow"}),t.jsx("a",{className:"iconbtn",href:u.src,target:"_blank",rel:"noreferrer","aria-label":"Open in a new tab",title:"Open in a new tab",children:t.jsx(is,{size:15})}),t.jsx("button",{className:"iconbtn",onClick:s,"aria-label":"Close",children:t.jsx(Xe,{size:16})})]}),t.jsx("img",{className:"lb-img",src:u.src,alt:u.caption,onMouseDown:d=>d.stopPropagation()}),o>1&&t.jsxs(t.Fragment,{children:[t.jsx("button",{className:"lb-nav prev",onClick:()=>c(-1),"aria-label":"Previous picture",children:t.jsx(lk,{size:22})}),t.jsx("button",{className:"lb-nav next",onClick:()=>c(1),"aria-label":"Next picture",children:t.jsx(lu,{size:22})})]})]}):null}function rm({src:e,alt:n,className:s}){const[r,a]=$.useState(!1);return t.jsxs(t.Fragment,{children:[t.jsx("button",{className:"zoom",onClick:()=>a(!0),"aria-label":`Open ${n} full size`,children:t.jsx("img",{className:s,src:e,alt:n,loading:"lazy"})}),r&&t.jsx(Gr,{pictures:[{src:e,caption:n}],start:0,onClose:()=>a(!1)})]})}function mo({text:e,ticket:n,stream:s,caret:r}){const[a,o]=$.useState(null),c=$.useMemo(()=>[[I7,{stream:s,caret:r}]],[s,r]);return t.jsxs("div",{className:"cmd",children:[t.jsx(Zf,{remarkPlugins:[nm],rehypePlugins:c,components:{a:({href:u,children:d})=>t.jsx("a",{href:u,target:"_blank",rel:"noreferrer",children:d}),img:({src:u,alt:d})=>{const p=u?/^(https?:|data:)/.test(u)?u:yn(n,u):"";return t.jsx("button",{className:"cimg",onClick:()=>o(p),"aria-label":`Open ${d||"the picture"} big`,children:t.jsx("img",{src:p,alt:d??"",loading:"lazy"})})},table:({node:u,children:d})=>t.jsx("div",{className:"ctable",children:t.jsx("table",{dir:u?.properties?.dir??void 0,children:d})}),pre:({node:u})=>t.jsx(pA,{node:u})},children:e}),a&&t.jsx(Gr,{pictures:[{src:a,caption:"Picture"}],start:0,onClose:()=>o(null)})]})}function fj(e){return e.type==="text"?e.value??"":(e.children??[]).map(fj).join("")}function pA({node:e}){const n=e.children?.find(o=>o.tagName==="code"),r=(n?.properties?.className??[]).find(o=>o.startsWith("language-"))?.slice(9)??"",a=fj(n??e).replace(/\n$/,"");if(r==="mermaid"){const o=hA(a);if(o)return t.jsx(mA,{chart:o})}return t.jsx(fA,{lang:r==="mermaid"?"Diagram (Mermaid)":r,code:a})}function fA({lang:e,code:n}){const{theme:s,toast:r}=qe(),a=()=>void navigator.clipboard?.writeText(n).then(()=>r("Code copied"),()=>r("Could not copy. Select the text instead.","err"));return t.jsxs("div",{className:"ccode",dir:"ltr",children:[t.jsxs("div",{className:"ccode-h",children:[t.jsx("span",{children:e||"text"}),t.jsxs("button",{className:"cact",onClick:a,"aria-label":"Copy the code",children:[t.jsx(ur,{size:13})," Copy"]})]}),t.jsx(pj,{code:n,language:e||"text",theme:s==="dark"?fo.vsDark:fo.github,children:({tokens:o,getLineProps:c,getTokenProps:u})=>t.jsx("pre",{children:o.map((d,p)=>t.jsx("div",{...c({line:d}),children:d.map((f,m)=>t.jsx("span",{...u({token:f})},m))},p))})})]})}function mA({chart:e}){const n=$.useRef(null),[s,r]=$.useState([]),a=$.useMemo(()=>{const c=[];for(const u of e.nodes)(c[u.rank]??=[]).push(u);return c.map(u=>(u??[]).sort((d,p)=>d.slot-p.slot))},[e]),o=$.useMemo(()=>new Set(e.nodes.filter(c=>!e.edges.some(u=>u.from===c.id)).map(c=>c.id)),[e]);return $.useLayoutEffect(()=>{const c=n.current;if(!c)return;const u=()=>{const p=c.getBoundingClientRect(),f=m=>c.querySelector(`[data-node="${CSS.escape(m)}"]`)?.getBoundingClientRect();r(e.edges.flatMap(m=>{const y=f(m.from),x=f(m.to);if(!y||!x)return[];const k=e.across?x.left>=y.right-1:x.top>=y.bottom-1;let v,b,N,C,S;if(e.across){v=(k?y.right:y.left)-p.left,b=y.top+y.height/2-p.top,N=(k?x.left:x.right)-p.left,C=x.top+x.height/2-p.top;const P=Math.max(24,Math.abs(N-v)/2)*(k?1:-1);S=`M${v},${b} C${v+P},${b} ${N-P},${C} ${N},${C}`}else{v=y.left+y.width/2-p.left,b=(k?y.bottom:y.top)-p.top,N=x.left+x.width/2-p.left,C=(k?x.top:x.bottom)-p.top;const P=Math.max(18,Math.abs(C-b)/2)*(k?1:-1);S=`M${v},${b} C${v},${b+P} ${N},${C-P} ${N},${C}`}return[{d:S,x:(v+N)/2,y:(b+C)/2,...m.label?{label:m.label}:{},...m.dashed?{dashed:!0}:{}}]}))};u();const d=new ResizeObserver(u);return d.observe(c),()=>d.disconnect()},[e]),t.jsx("div",{className:"cdiagram",dir:"ltr",children:t.jsxs("div",{ref:n,className:`cflow ${e.across?"across":"down"}`,children:[t.jsxs("svg",{className:"cflow-lines","aria-hidden":"true",children:[t.jsx("defs",{children:t.jsx("marker",{id:"cflow-arrow",viewBox:"0 0 10 10",refX:"9",refY:"5",markerWidth:"7",markerHeight:"7",orient:"auto-start-reverse",children:t.jsx("path",{d:"M0,0 L10,5 L0,10 z"})})}),s.map((c,u)=>t.jsx("path",{d:c.d,className:c.dashed?"dash":"",markerEnd:"url(#cflow-arrow)"},u))]}),a.map((c,u)=>t.jsx("div",{className:"cflow-rank",children:c.map(d=>t.jsx("span",{"data-node":d.id,className:`cnode ${d.shape} ${o.has(d.id)&&d.shape!=="decision"?"end":""}`,children:t.jsx("bdi",{children:d.text})},d.id))},u)),s.map((c,u)=>c.label?t.jsx("span",{className:"cflow-label",style:{left:c.x,top:c.y},children:c.label},u):null)]})})}function gA({lines:e,children:n}){const[s,r]=$.useState(!1);return e<=26?t.jsx(t.Fragment,{children:n}):t.jsxs("div",{className:`cfold ${s?"open":""}`,children:[t.jsx("div",{className:"cfold-body",children:n}),t.jsx("button",{className:"btn sm",onClick:()=>r(!s),children:s?"Show less":`Show all · ${e} lines`})]})}function xA(e){return e.split(`
605
- `).reduce((n,s)=>n+(s.trim()?Math.ceil(s.length/80):0),0)}const wy=/\.(png|jpe?g|gif|webp)$/i,Ny=/\.html?$/i;function mj({ticket:e,files:n}){const s=n.filter(o=>wy.test(o)),r=n.filter(o=>Ny.test(o)),a=n.filter(o=>!wy.test(o)&&!Ny.test(o));return t.jsxs("div",{className:"attached",children:[r.map(o=>t.jsx(im,{ticket:e,file:o},o)),s.length>0&&t.jsx("div",{className:"attpics",children:s.map(o=>t.jsx(rm,{src:yn(e,o),alt:Sy(o)},o))}),a.map(o=>t.jsxs("a",{className:"btn sm",href:yn(e,o),download:!0,children:[t.jsx(ls,{size:13})," ",Sy(o)]},o))]})}function im({ticket:e,file:n,title:s="Mockup"}){const[r,a]=$.useState(!1),o=Pe({queryKey:["mockup-link",e,n],queryFn:()=>Ee(`/api/v1/tickets/${encodeURIComponent(e)}/mockup-link?path=${encodeURIComponent(n)}`),staleTime:1/0});if(o.isError)return t.jsx("p",{className:"note",children:"The mockup could not be read."});const c=u=>t.jsx("iframe",{className:u,title:s,sandbox:"allow-scripts",src:o.data?.url??"about:blank"});return t.jsxs("div",{className:"mockup",children:[t.jsxs("div",{className:"mockbar",children:[t.jsxs("span",{children:[s," · click around, it is only a picture of the idea"]}),t.jsxs("button",{className:"btn sm",onClick:()=>a(!0),children:[t.jsx(cu,{size:12})," Full size"]})]}),c("mockframe"),r&&t.jsx(Ve,{title:s,wide:!0,onClose:()=>a(!1),children:c("mockframe big")})]})}function Sy(e){return e.split(/[\\/]/).pop()??e}const Xp=/\.(png|jpe?g|gif|webp|bmp)$/i,Cy=/\.(mp4|webm|mov|m4v)$/i,Jp=/\.(ogg|opus|oga|m4a|mp3|wav|aac|amr|flac|weba)$/i,gj=/\.(md|markdown)$/i,xj=/\.pdf$/i,yj=/\.html?$/i;function ws(e){return e.split(/[\\/]/).pop()??e}function kj(e){return gj.test(e)?{cls:"md",label:"MD"}:xj.test(e)?{cls:"pdf",label:"PDF"}:yj.test(e)?{cls:"html",label:"HTML"}:Xp.test(e)?{cls:"img",label:(e.split(".").pop()??"IMG").toUpperCase().slice(0,4)}:{cls:"file",label:(e.split(".").pop()??"FILE").toUpperCase().slice(0,4)}}function am({ticket:e,files:n,from:s,onOpen:r,sent:a}){const[o,c]=$.useState(null),[u,d]=$.useState(null),p=n.filter(x=>Xp.test(x)),f=n.filter(x=>Cy.test(x)),m=n.filter(x=>Jp.test(x)),y=n.filter(x=>!Xp.test(x)&&!Cy.test(x)&&!Jp.test(x)&&!/\.transcript\.txt$/.test(x));return t.jsxs("div",{className:"cfiles",children:[p.length>0&&t.jsx("div",{className:"cshots",children:p.map((x,k)=>t.jsxs("button",{className:"cshot",onClick:()=>c(k),"aria-label":`Open ${ws(x)} big`,children:[t.jsx("img",{src:yn(e,x),alt:ws(x),loading:"lazy"}),a&&t.jsx("span",{className:"cshot-ok",title:"Sent",children:t.jsx(xe,{size:11,strokeWidth:3})})]},x))}),f.map(x=>t.jsxs("div",{className:"cvideo",children:[t.jsx("video",{src:yn(e,x),controls:!0,preload:"metadata"}),t.jsx(vj,{ticket:e,file:x})]},x)),m.map(x=>t.jsx(kA,{ticket:e,file:x},x)),y.map(x=>{const k=kj(x),v=gj.test(x),b=xj.test(x),N=yj.test(x),C=v?"Markdown · opens beside the chat":b?"PDF · opens beside the chat":N?"Mockup · runs here, sealed off":"File · downloads",S=t.jsxs(t.Fragment,{children:[t.jsx("span",{className:`cfic ${k.cls}`,children:k.label}),t.jsxs("span",{className:"cfile-t",children:[t.jsx("span",{className:"cfname",children:ws(x)}),t.jsx("span",{className:"cfmeta",children:C})]}),t.jsx("span",{className:"cfopen",children:v||b||N?"Open":t.jsx(ls,{size:14})})]});return v||b?t.jsx("button",{className:"cfile",onClick:()=>r?.({ticket:e,file:x,kind:v?"md":"pdf",...s?{from:s}:{}}),children:S},x):N?t.jsx("button",{className:"cfile",onClick:()=>d(x),children:S},x):t.jsx("a",{className:"cfile",href:yn(e,x),download:!0,children:S},x)}),o!==null&&t.jsx(Gr,{pictures:p.map(x=>({src:yn(e,x),caption:ws(x)})),start:o,onClose:()=>c(null)}),u&&t.jsx(Ve,{title:ws(u),wide:!0,onClose:()=>d(null),children:t.jsx(im,{ticket:e,file:u,title:ws(u)})})]})}function yA(e,n){return Pe({queryKey:["transcript",e,n],queryFn:async()=>{const s=await fetch(yn(e,`${n}.transcript.txt`));return s.ok&&(await s.text()).replace(/^Transcript of [^\n]*\n+/,"").trim()||null},staleTime:3e4,refetchInterval:s=>s.state.data?!1:1e4})}function vj({ticket:e,file:n,open:s=!0}){const r=yA(e,n).data,[a,o]=$.useState(s);return r?t.jsxs(t.Fragment,{children:[t.jsx("button",{className:"ctlink",onClick:()=>o(!a),children:a?"Hide the written text":"Show the written text"}),a&&t.jsx("div",{className:"ctrans",children:r.split(/\n+/).map((c,u)=>{const d=In(c);return t.jsx("p",{dir:d.dir,lang:d.dir==="rtl"?"ar":"en",className:Is(d),children:c},u)})})]}):null}function kA({ticket:e,file:n}){const s=$.useRef(null),[r,a]=$.useState(!1),[o,c]=$.useState({at:0,length:0}),u=$.useMemo(()=>{let m=7;for(const y of n)m=(m*31+y.charCodeAt(0))%9973;return Array.from({length:34},(y,x)=>6+m*(x+3)*7%19)},[n]);$.useEffect(()=>{const m=s.current;if(!m)return;const y=()=>c({at:m.currentTime,length:Number.isFinite(m.duration)?m.duration:0}),x=()=>a(!1);return m.addEventListener("timeupdate",y),m.addEventListener("loadedmetadata",y),m.addEventListener("ended",x),()=>{m.removeEventListener("timeupdate",y),m.removeEventListener("loadedmetadata",y),m.removeEventListener("ended",x)}},[]);const d=()=>{const m=s.current;m&&(r?m.pause():m.play().catch(()=>a(!1)),a(!r))},p=r||o.at>0?o.at:o.length,f=o.length?Math.min(1,o.at/o.length):0;return t.jsxs("div",{className:"cvoice-w",children:[t.jsxs("div",{className:"cvoice",children:[t.jsx("button",{className:"cplay",onClick:d,"aria-label":r?"Pause the voice note":"Play the voice note",children:r?t.jsx(uu,{size:15,fill:"currentColor"}):t.jsx(Wi,{size:15,fill:"currentColor"})}),t.jsx("div",{className:"cwave","aria-hidden":"true",children:u.map((m,y)=>t.jsx("i",{style:{height:m},className:y/u.length<f?"on":""},y))}),t.jsx("span",{className:"cvt",children:vA(p)}),t.jsx("audio",{ref:s,src:yn(e,n),preload:"metadata"})]}),t.jsx(vj,{ticket:e,file:n})]})}function vA(e){const n=Math.max(0,Math.round(e));return`${Math.floor(n/60)}:${String(n%60).padStart(2,"0")}`}function om({doc:e,onClose:n}){const{toast:s}=qe(),r=yn(e.ticket,e.file),a=Pe({queryKey:["doc",e.ticket,e.file],queryFn:async()=>{const u=await fetch(r);if(!u.ok)throw new Error("The file could not be read.");return u.text()},enabled:e.kind==="md"}),o=kj(e.file),c=()=>void navigator.clipboard?.writeText(a.data??"").then(()=>s("Document copied"));return t.jsxs("section",{className:"cdoc","aria-label":ws(e.file),children:[t.jsxs("div",{className:"cdoc-h",children:[t.jsx("span",{className:`cfic sm ${o.cls}`,children:o.label}),t.jsxs("div",{className:"grow",children:[t.jsx("div",{className:"cfname",children:ws(e.file)}),t.jsx("div",{className:"cfmeta",children:e.from??(e.kind==="md"?"Markdown":"PDF")})]}),e.kind==="md"&&t.jsx("button",{className:"btn sm",onClick:c,disabled:!a.data,children:"Copy"}),e.kind==="pdf"&&t.jsx("a",{className:"btn sm",href:r,target:"_blank",rel:"noreferrer",children:"Open in a tab"}),t.jsx("button",{className:"iconbtn",onClick:n,"aria-label":"Close the document",children:t.jsx(Xe,{size:16})})]}),e.kind==="md"?t.jsx("div",{className:"cdoc-b",children:a.isError?t.jsx("p",{className:"note",children:"The file could not be read."}):a.data?t.jsx(mo,{text:a.data,ticket:e.ticket}):t.jsx("p",{className:"note",children:"Loading…"})}):t.jsx("iframe",{className:"cdoc-pdf",src:r,title:ws(e.file)})]})}function jj(e){const n=[],s=new Map;for(const{at:r,update:a}of e)switch(a.sessionUpdate){case"user_message_chunk":{const o=a.content.type==="text"&&a.content._meta?.squadKit?.from==="claude-code"?"claude-code":"squad-kit";n.push({kind:"message",from:o,content:a.content,at:r});break}case"agent_message_chunk":n.push({kind:"message",from:"agent",content:a.content,at:r});break;case"agent_thought_chunk":n.push({kind:"message",from:"thought",content:a.content,at:r});break;case"plan":n.push({kind:"plan",entries:a.entries,at:r});break;case"tool_call":{const o={kind:"tool",id:a.toolCallId,title:a.title,toolKind:a.kind??"other",status:a.status??"in_progress",content:[...a.content??[]],command:a.rawInput?.command,at:r};s.set(a.toolCallId,o),n.push(o);break}case"tool_call_update":{const o=s.get(a.toolCallId);if(!o)break;a.status&&(o.status=a.status),a.title&&(o.title=a.title),a.kind&&(o.toolKind=a.kind),a.rawInput?.command&&(o.command=a.rawInput.command),a.content&&(o.content=[...a.content]),a._meta?.squadKit?.blocked?.length&&(o.blocked=a._meta.squadKit.blocked);break}}for(const r of s.values())CA(r);return n}const jA=/^(StructuredOutput|Gave squad-kit its answer|Handed in its answer)$/,bA=/^structured output provided successfully\.?$/i,$y=/User refused permission to run tool|^Permission denied: |haven't granted it yet/i;function np(e){return e.type==="content"&&e.content.type==="text"?e.content.text.trim():""}function wA(e){return e==="execute"?"Skipped a command this step may not run":e==="edit"||e==="delete"||e==="move"?"Skipped a change this step may not make":"Skipped something this step may not do"}const NA={bash:"Ran a command",terminal:"Ran a command",read:"Read a file",write:"Wrote a file",edit:"Changed a file",multiedit:"Changed a file",notebookedit:"Changed a notebook",glob:"Looked for files",grep:"Searched the code",ls:"Listed a folder",todowrite:"Updated its plan",task:"Asked a helper",agent:"Asked a helper",webfetch:"Opened a web page",fetch:"Opened a web page",websearch:"Searched the web","web search":"Searched the web",enterplanmode:"Planned its work",exitplanmode:"Planned its work","exited plan mode":"Planned its work","approve plan":"Planned its work","unknown tool":"Used a tool"};function SA(e){const n=e.trim(),s=NA[n.toLowerCase()];if(s)return s;const r=/^mcp__([^_]+(?:_[^_]+)*)__(.+)$/.exec(n);return r?`Used ${r[2].replace(/_/g," ")} from ${r[1].replace(/_/g," ")}`:/^[A-Z][a-z]+(?:[A-Z][a-z]+)+$/.test(n)?`Used ${n.replace(/([a-z])([A-Z])/g,"$1 $2").toLowerCase()}`:null}function CA(e){if(e.toolKind==="execute"&&e.command&&e.title.trim()===e.command.trim()&&(e.title=`Ran ${e.command.split(`
606
- `)[0].slice(0,80)}`),jA.test(e.title)){e.answer=!0,e.title="Handed in its answer",e.content=e.content.filter(s=>!bA.test(np(s)));return}if(e.status==="failed"&&e.content.some(s=>$y.test(np(s)))){e.skipped=!0,e.detail=e.title,e.title=wA(e.toolKind),e.content=e.content.filter(s=>!$y.test(np(s)));return}const n=SA(e.title);n&&(e.title=n)}function $A(e){return(e?.options??[]).map((n,s)=>{const r=n.do??(s===0?"retry":void 0);return{index:s,label:n.name,note:n.note,way:r,needs:r==="continue"||r==="skip-hooks"?"reason":r==="yourself"?"fix":null,primary:s===0}})}function EA(e){return e?.title??"The squad stopped and needs you"}const Ey={cursor:"Cursor",code:"VS Code"};function ju({t:e}){const n=pe(),r=Pe({queryKey:["editors"],queryFn:()=>Ee("/api/v1/editors"),staleTime:3e5}).data?.editors[0];return t.jsxs("button",{className:"btn sm",disabled:n.isPending||!e.baseCommit,title:e.baseCommit?void 0:"Nothing built yet",onClick:()=>n.mutate({path:`/api/v1/tickets/${e.id}/open-editor`,body:r?{editor:r}:{},done:`Opened in ${r?Ey[r]:"your editor"}`}),children:[t.jsx(is,{size:13})," Open in ",r?Ey[r]:"editor"]})}function TA({t:e}){const n=Pe({queryKey:["changes",e.id,e.activity.length],queryFn:()=>Ee(`/api/v1/tickets/${e.id}/changes`),refetchInterval:e.live?1e4:!1}),s=n.data,r=s?.files.reduce((o,c)=>o+c.added,0)??0,a=s?.files.reduce((o,c)=>o+c.removed,0)??0;return t.jsxs("div",{className:"db",children:[t.jsxs("div",{className:"changes-head",children:[t.jsxs("div",{children:[s&&s.files.length>0?t.jsxs(t.Fragment,{children:[t.jsxs("b",{children:[s.files.length," ",s.files.length===1?"file":"files"," changed"]})," ",t.jsxs("span",{className:"add",children:["+",r]})," ",t.jsxs("span",{className:"del",children:["−",a]})]}):t.jsx("b",{children:"Changes"}),t.jsx("p",{className:"note",children:s?.from==="branch"?`Read from branch ${s.branch}. The copy was removed after the release.`:"The squad builds in its own copy of the code, so your folder stays yours. These changes reach your folder after Looks right."})]}),t.jsx("span",{className:"grow"}),t.jsx(ju,{t:e})]}),n.isLoading&&t.jsx("p",{className:"note",children:"Reading the changes…"}),n.error&&t.jsx("p",{className:"note",children:n.error.message}),s&&!s.files.length&&t.jsx("p",{className:"note",children:s.from==="none"?"Nothing built yet.":"No changes against main yet."}),s?.cut&&t.jsx("p",{className:"note",children:"This change is very large, so some files show only their name. Open it in your editor to see all of it."}),s?.files.map(o=>t.jsx(AA,{f:o},o.path)),t.jsxs("div",{className:"pills",style:{marginTop:12},children:[t.jsx(se,{text:`squad changes ${e.id} --full`}),t.jsx(se,{text:`squad open ${e.id}`})]})]})}function AA({f:e}){const n=e.patch?e.patch.split(`
607
- `):[],[s,r]=$.useState(n.length<=300);return t.jsxs("div",{className:"conv-diff",children:[t.jsxs("button",{className:"conv-diff-head mono changes-file",onClick:()=>r(!s),children:[t.jsx("span",{className:`fstat ${e.status}`,children:e.status==="added"?"new":e.status==="deleted"?"deleted":e.status==="renamed"?"moved":"changed"}),t.jsx("span",{style:{overflowWrap:"anywhere",textAlign:"left"},children:e.path}),t.jsx("span",{className:"grow"}),e.binary?t.jsx("span",{children:"binary"}):t.jsxs("span",{children:[t.jsxs("span",{className:"add",children:["+",e.added]})," ",t.jsxs("span",{className:"del",children:["−",e.removed]})]})]}),s&&n.length>0&&t.jsx("pre",{children:n.map((a,o)=>a.startsWith("@@")?t.jsx("div",{className:"gap",children:a.replace(/^(@@[^@]*@@).*/,"$1")},o):t.jsxs("div",{className:a.startsWith("+")?"add":a.startsWith("-")?"del":"same",children:[t.jsx("span",{className:"sign",children:a.startsWith("+")?"+":a.startsWith("-")?"−":" "}),a.slice(1)||" "]},o))})]})}function bu({ticket:e,app:n,small:s,label:r="Report a problem"}){return t.jsxs("button",{className:`btn ${s?"sm":""}`,onClick:()=>Po.open({...e?{ticket:e}:{},...n?{app:n}:{}}),children:[t.jsx($f,{size:s?13:14})," ",r]})}function PA(){const e=i8();return e?t.jsx(IA,{ask:e,onClose:Po.close},`${e.ticket??""}${e.app?"app":""}`):null}function RA(e){return/[\\/]Downloads$/.test(e)?" in your Downloads folder":""}function IA({ask:e,onClose:n}){const{toast:s}=qe(),[r,a]=$.useState(null),[o,c]=$.useState(null),[u,d]=$.useState(""),[p,f]=$.useState(!1),[m,y]=$.useState(null),x=e.app?null:gt,k=new URLSearchParams({...x?{project:x}:{},...x&&e.ticket?{ticket:e.ticket}:{}}).toString();$.useEffect(()=>{let N=!0;return Ee(`/api/v1/app/report${k?`?${k}`:""}`).then(C=>N&&a(C)).catch(C=>N&&c(C.message)),()=>{N=!1}},[k]);const v=async()=>{f(!0),c(null);try{y(await bt("/api/v1/app/report","POST",{...x?{project:x}:{},...x&&e.ticket?{ticket:e.ticket}:{},...u.trim()?{note:u}:{}}))}catch(N){c(N instanceof Error?N.message:String(N))}finally{f(!1)}},b=N=>{const C=navigator.clipboard?.writeText(N);if(!C)return s("Could not copy. Select the text instead.","err");C.then(()=>s("Copied where the file is"),()=>s("Could not copy. Select the text instead.","err"))};return m?.file?t.jsxs(Ve,{title:"Report saved",onClose:n,footer:t.jsxs(t.Fragment,{children:[t.jsxs("button",{className:"btn pri",onClick:n,children:[t.jsx(xe,{size:15,strokeWidth:2.5})," Done"]}),t.jsxs("button",{className:"btn",onClick:()=>b(m.file),children:[t.jsx(ur,{size:14})," Copy where it is"]})]}),children:[t.jsxs("div",{className:"report-saved",role:"status",children:[t.jsx("span",{className:"report-ok",children:t.jsx(xe,{size:16,strokeWidth:2.6})}),t.jsxs("div",{children:[t.jsxs("b",{children:["Saved ",m.name,RA(m.folder)]}),t.jsx("span",{className:"mono",children:m.file})]})]}),t.jsx("p",{className:"report-send",children:"Send this file to whoever helps you with squad-kit."}),t.jsx("p",{className:"note",children:"It holds no tokens or passwords. You can open it first to see what is inside: README.txt lists every file."})]}):t.jsxs(Ve,{title:"Report a problem",onClose:n,footer:t.jsxs(t.Fragment,{children:[t.jsxs("button",{className:"btn pri",disabled:!r||p,onClick:()=>void v(),children:[p?t.jsx(jn,{size:15,className:"spin"}):t.jsx($f,{size:15})," ",r?`Save ${r.name}`:"Save the report"]}),t.jsx("button",{className:"btn",onClick:n,children:"Cancel"}),t.jsx("span",{className:"grow"}),r&&t.jsx(se,{text:r.command})]}),children:[t.jsx("p",{children:"squad-kit saves one file you can send to your engineer or to squad-kit support."}),r?t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"lbl",children:"The file holds"}),t.jsx("ul",{className:"safe-list",children:r.holds.map(N=>t.jsxs("li",{children:[t.jsx(xe,{size:15,strokeWidth:2.6,"aria-hidden":"true"}),N]},N))}),t.jsxs("div",{className:"report-never",children:[t.jsx("b",{children:"Never included:"})," ",r.never.replace(/^Never included:\s*/,"")]})]}):!o&&t.jsx("p",{className:"note",children:"Looking at what the file will hold…"}),t.jsxs("div",{className:"field",style:{marginTop:14},children:[t.jsx("label",{htmlFor:"report-what",children:"What happened? (optional)"}),t.jsx("textarea",{id:"report-what",className:"waynote",rows:3,value:u,onChange:N=>d(N.target.value),placeholder:"For example: it stopped after I approved the design"})]}),o&&t.jsx("p",{className:"report-err",role:"alert",children:o})]})}function zA(){return t.jsxs("div",{className:"maprow",style:{alignItems:"center"},children:[t.jsx("b",{children:"Something wrong?"}),t.jsxs("span",{style:{display:"flex",gap:10,alignItems:"center",flexWrap:"wrap"},children:[t.jsx(bu,{app:!0,small:!0}),t.jsx("span",{className:"note",children:"One file to send: squad-kit's log for the last 24 hours and the versions. Never your tokens or passwords."}),t.jsx(se,{text:"squad report"}),t.jsx(se,{text:"squad logs"})]})]})}const bj="squad.draft.",MA=720*60*60*1e3,Li=new Map;function Do(){try{return window.localStorage}catch{return null}}function go(e,n,s){return`${bj}${e??"app"}.${n}.${s}`}function FA(e,n){const s=Li.get(e);if(s!==void 0)return s;try{return n?.getItem(e)??null}catch{return null}}function Kc(e,n=Do(),s=Date.now()){const r=FA(e,n);if(r)try{const{v:a,at:o}=JSON.parse(r);return s-o>MA?void 0:a}catch{return}}function wj(e,n,s=Do(),r=Date.now()){const a=JSON.stringify({v:n,at:r});try{if(!s)throw new Error("no storage");s.setItem(e,a),Li.delete(e)}catch{Li.set(e,a)}}function xo(e,n=Do()){Li.delete(e);try{n?.removeItem(e)}catch{}}function Ty(e,n,s=Do()){const r=go(e,n,"");for(const a of[...Li.keys()])a.startsWith(r)&&Li.delete(a);if(s)try{const a=[];for(let o=0;o<s.length;o+=1){const c=s.key(o);c?.startsWith(r)&&a.push(c)}for(const o of a)s.removeItem(o)}catch{}}function LA(e=Do(),n=Date.now()){if(e)try{const s=[];for(let r=0;r<e.length;r+=1){const a=e.key(r);a?.startsWith(bj)&&Kc(a,e,n)===void 0&&s.push(a)}for(const r of s)e.removeItem(r)}catch{}}function we(e,n,s){const r=go(gt,e,n),a=$.useRef(JSON.stringify(s)),[o,c]=$.useState(()=>Kc(r)??s),u=$.useRef(r);u.current!==r&&(u.current=r,a.current=JSON.stringify(s),c(Kc(r)??s)),$.useEffect(()=>{JSON.stringify(o)===a.current?xo(r):wj(r,o)},[r,o]);const d=$.useCallback(()=>{xo(r),c(s)},[r]);return[o,c,d]}function lm({title:e,what:n,safe:s=[],ways:r,report:a,hint:o,calm:c,children:u}){return t.jsxs("div",{className:`drafterr errcard${c?" calm":""}`,role:"alert",children:[t.jsx("b",{className:"errcard-title",children:e}),t.jsx("div",{className:"errcard-what",children:n}),s.length>0&&t.jsx("ul",{className:"safe-list",children:s.map(d=>t.jsxs("li",{children:[t.jsx(xe,{size:15,strokeWidth:2.6,"aria-hidden":"true"}),d]},d))}),t.jsx("div",{className:"errcard-lbl",children:"What you can do"}),t.jsxs("div",{className:"drafterr-ways",children:[r.map(d=>t.jsxs("button",{className:`btn ${d.primary?"pri":""}`,disabled:d.disabled,title:d.title,onClick:d.onClick,children:[d.icon,d.label]},d.label)),a!==!1&&t.jsx(bu,{...a??{}})]}),o&&t.jsx("div",{className:"errcard-hint",children:o}),u]})}function _A({t:e,extra:n}){const s=pe(),[r,a,o]=we(e.id,"stuck-open",null),[c,u,d]=we(e.id,"stuck-text",""),p=$A(e.stuck),f=(b,N,C)=>s.mutate({path:`/api/v1/tickets/${e.id}/decide`,body:{choice:b,...N},done:C},{onSuccess:()=>{o(),d()}}),m=p.find(b=>b.way==="retry"),y=r==="reason"||r==="fix"?p.find(b=>b.needs===r):void 0,x=r==="note"&&c.trim()?c.trim():"",k=p.map(b=>({label:b.label,title:b.note,primary:b.primary,disabled:s.isPending,icon:b.way==="retry"?t.jsx(qr,{size:14}):b.way==="yourself"?t.jsx(co,{size:14}):void 0,onClick:()=>{if(b.needs){a(r===b.needs?null:b.needs),u("");return}f(b.index,b.way==="retry"&&x?{note:x}:{},b.way==="retry"?"Trying again. The squad carries on.":"Decided. The squad carries on.")}})),v=y?`squad decide ${e.id} ${y.index+1}${y.needs==="reason"?` --reason ${Le(c.trim()||"…")}`:""}`:`squad decide ${e.id}${m&&x?` ${m.index+1} --note ${Le(x)}`:""}`;return t.jsxs("div",{className:"db",children:[t.jsx(lm,{title:EA(e.stuck),calm:e.stuck?.kind==="no-tests"||e.stuck?.gate==="cap",what:e.stuck?.points?.length?t.jsxs(t.Fragment,{children:[e.stuck.question,t.jsx("ul",{className:"errcard-points",children:e.stuck.points.map(b=>t.jsx("li",{children:b},b))})]}):e.stuck?.question??"",safe:e.stuck?.safe??["Nothing was lost: the work so far is kept."],ways:k,report:{ticket:e.id},hint:t.jsxs(t.Fragment,{children:[m&&r!=="note"&&t.jsx("button",{className:"linkbtn",onClick:()=>a("note"),children:"Add a note for the squad first"}),e.stuck?.detail?" Engineers: the exact error is in the Developer tab.":""]})}),r==="note"&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"lbl",children:"A note for the squad (optional)"}),t.jsx("textarea",{className:"waynote",rows:2,value:c,onChange:b=>u(b.target.value),placeholder:"For example: the test server needs the VPN, it is on now"}),t.jsxs("p",{className:"note",style:{fontSize:12.5},children:["The squad reads it first when you press ",m?.label??"Try again","."]})]}),r==="reason"&&y&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"lbl",children:y.way==="skip-hooks"?"Why save it without the check?":"Why continue anyway?"}),t.jsx("textarea",{className:"waynote",rows:2,value:c,onChange:b=>u(b.target.value),placeholder:y.way==="skip-hooks"?"For example: the check needs a licence this laptop does not have":"For example: the failing test is broken on main too, fixed in SK-160"}),t.jsx("p",{className:"note",style:{fontSize:12.5},children:"Only you can do this. Your reason shows on the ticket, the pull request and the release notes."}),t.jsx("div",{className:"errcard-confirm",children:t.jsxs("button",{className:"btn pri",disabled:!c.trim()||s.isPending,onClick:()=>f(y.index,{reason:c},"Decided. The squad carries on."),children:[t.jsx(xe,{size:15,strokeWidth:2.5})," ",y.label]})})]}),r==="fix"&&y&&t.jsxs("div",{className:"stuckbox",style:{marginTop:12},children:[t.jsxs("p",{style:{margin:"0 0 8px"},children:["Open the ticket's copy, fix it, and save. Then press ",t.jsx("b",{children:"I fixed it"}),": the checks, review and proof run again."]}),t.jsxs("div",{className:"errcard-confirm",children:[t.jsx(ju,{t:e}),t.jsxs("button",{className:"btn pri",disabled:s.isPending,onClick:()=>f(y.index,{},"OK. The checks run again on your fix."),children:[t.jsx(xe,{size:15,strokeWidth:2.5})," I fixed it, check again"]})]})]}),t.jsx("div",{className:"errcard-cmd",children:t.jsx(se,{text:v})}),n]})}function OA({t:e}){const{toast:n}=qe();if(!e.stuck||e.waiting?.kind!=="stuck")return null;const s=e.stuck.detail??e.stuck.question,r=()=>{const a=navigator.clipboard?.writeText(s);if(!a)return n("Could not copy. Select the text instead.","err");a.then(()=>n("Copied the exact error"),()=>n("Could not copy. Select the text instead.","err"))};return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"lbl",children:"The exact error"}),t.jsx("pre",{className:"exact-err",children:s}),t.jsxs("div",{className:"pills",style:{marginTop:8},children:[t.jsxs("button",{className:"btn sm",onClick:r,children:[t.jsx(ur,{size:13})," Copy"]}),t.jsx(bu,{ticket:e.id,small:!0}),t.jsx(se,{text:"squad logs --tail"})]})]})}const Ay=10*1024*1024;function yo(e){return new Promise((n,s)=>{const r=new FileReader;r.onload=()=>{const a=String(r.result);n({name:e.name,size:e.size,data:a.slice(a.indexOf(",")+1),...e.type.startsWith("image/")?{preview:a}:{}})},r.onerror=()=>s(new Error(`Could not read ${e.name}`)),r.readAsDataURL(e)})}function qA(e){const n=/\.(png|jpe?g|gif|webp)$/i.exec(e.name)?.[1]?.toLowerCase();return n?{preview:`data:image/${n==="jpg"?"jpeg":n};base64,${e.data}`}:{}}const Et="new-ticket";function Nj({onClose:e,onCreated:n}){const s=pe(),{toast:r}=qe(),[a,o]=we(Et,"mode","write"),[c,u]=we(Et,"pasted",""),[d,p]=$.useState(null),[f,m]=$.useState(null),y=d?.status==="working",[x,k]=$.useState(null),[v,b]=we(Et,"title",""),[N,C]=we(Et,"ask",""),[S,P]=we(Et,"kind","feature"),[M,T]=we(Et,"priority","normal"),[F,R]=we(Et,"track","full"),[B,I]=$.useState(!1),[O,_]=$.useState(null),[Q,q]=we(Et,"criteria",[]),[K,ce]=we(Et,"rules",[]),[H,V]=we(Et,"edge-cases",[]),[ne,A]=we(Et,"what",""),[D,ee]=we(Et,"steps",[]),[z,me]=we(Et,"expected",""),[he,ke]=we(Et,"where",""),[Re,Ae]=we(Et,"severity","annoying"),$e=S==="bug",[De,ct]=$.useState([]),Ut=async J=>{const Fe=[...J],Nt=Fe.find(yt=>yt.size>Ay);Nt&&r(`${Nt.name} is larger than 10 MB.`,"err");const st=await Promise.all(Fe.filter(yt=>yt.size<=Ay).map(yo)).catch(yt=>(r(yt.message,"err"),[]));ct(yt=>[...yt,...st].slice(0,10))},on=De.map(({name:J,data:Fe})=>({name:J,data:Fe})),Kn=J=>{b(J.title),C(J.ask),J.kind==="bug"&&A(J.ask),P(J.kind),T(J.priority),J.track&&(R(J.track),_(J.track)),q(J.criteria),ce(J.rules),V(J.edgeCases),k(J.gaps),o("write")};$.useEffect(()=>{let J=!0;return Ee("/api/v1/tickets/draft/current").then(async({draft:Fe})=>{if(!(!J||!Fe)&&(u(Fe.text),o("paste"),p(Fe),Fe.files.length)){const Nt=await Ee(`/api/v1/tickets/draft/${Fe.id}/files`).catch(()=>({files:[]}));J&&ct(Nt.files.map((st,yt)=>({...st,size:Fe.files[yt]?.size??0,...qA(st)})))}}).catch(()=>{}),()=>{J=!1}},[]);const Ht=Pe({queryKey:["ticket-draft",d?.id],queryFn:()=>Ee(`/api/v1/tickets/draft/${d.id}`),enabled:y,refetchInterval:1e3,retry:!1});$.useEffect(()=>{Ht.data&&d?.status==="working"&&Ht.data.id===d.id&&p(Ht.data)},[Ht.data]),$.useEffect(()=>{Ht.isError&&y&&p(J=>J&&{...J,status:"failed",error:"squad-kit lost this draft, maybe because it restarted."})},[Ht.isError]);const Mn=$.useRef(null);$.useEffect(()=>{d?.status==="done"&&d.draft&&Mn.current!==d.id&&(Mn.current=d.id,Kn(d.draft))},[d]);const bn=async()=>{m(null);try{p(await bt("/api/v1/tickets/draft","POST",{text:c,files:on}))}catch(J){m(J instanceof Error?J.message:String(J))}},ln=async()=>{if(d)try{p(await bt(`/api/v1/tickets/draft/${d.id}/cancel`,"POST"))}catch{p({...d,status:"cancelled"})}},Vt=()=>{d&&bt(`/api/v1/tickets/draft/${d.id}/dismiss`,"POST").catch(()=>{}),p(null)},xt=()=>{Vt(),m(null),N.trim()||C(c.trim()),ne.trim()||A(c.trim()),o("write")},cn=()=>{Vt(),k(null),_(null);for(const J of[b,C,A,me,ke])J("");for(const J of[q,ce,V,ee])J([]);o("paste")},Yn=()=>{cn(),u(""),ct([]),o("write"),P("feature"),T("normal"),R("full"),Ae("annoying"),Ty(gt,Et)},Ms=!!(c||v||N||ne||z||he||Q.length||K.length||H.length||D.length),Qn=D.filter(J=>J.trim()),He=[ne.trim()&&`What happens:
608
- ${ne.trim()}`,Qn.length&&`Steps to see it:
609
- ${Qn.map((J,Fe)=>`${Fe+1}. ${J.trim()}`).join(`
610
- `)}`,z.trim()&&`What should happen:
611
- ${z.trim()}`,he.trim()&&`Where: ${he.trim()}`].filter(Boolean).join(`
612
-
613
- `),X=$e?{title:v,ask:He,kind:S,severity:Re,priority:Re==="stops-work"?"high":Re==="small"?"low":"normal",track:F,files:on,talkFirst:B&&F==="full"}:{title:v,ask:N,kind:S,track:F,priority:M,criteria:Q,rules:K,edgeCases:H,files:on,talkFirst:B&&F==="full"},le=()=>s.mutate({path:"/api/v1/tickets",body:X},{onSuccess:J=>{Vt(),Ty(gt,Et),n(J),e()}}),be=!!f||d?.status==="failed"||d?.status==="cancelled",Me=a==="paste"?`squad new --from ${Le(c.trim().split(`
614
- `)[0]?.slice(0,40)||"your message")}`:[`squad new ${Le(v.trim()||"Your title")}`,$e?`--bug --severity ${Re}`:"",$e&&ne.trim()?`--ask ${Le(ne.trim())}`:"",F==="express"?"--express":"",B&&F==="full"?"--talk":"",...$e?[]:Q.filter(J=>J.trim()).map(J=>`--criteria ${Le(J)}`),...$e?[]:K.filter(J=>J.trim()).map(J=>`--rule ${Le(J)}`),...$e?[]:H.filter(J=>J.trim()).map(J=>`--edge ${Le(J)}`),...De.map(J=>`--attach ${Le(J.name)}`)].filter(Boolean).join(" ");return t.jsxs(Ve,{title:"New ticket",wide:!0,onClose:e,losing:De.length?De.length===1?"the attached file":`the ${De.length} attached files`:null,icon:t.jsx("span",{className:"glyph",children:t.jsx(Tt,{size:15})}),footer:t.jsxs(t.Fragment,{children:[a==="paste"?be?null:t.jsxs("button",{className:"btn pri",disabled:!c.trim()&&!De.length||y,onClick:()=>void bn(),children:[y?t.jsx(jn,{size:15,className:"spin"}):t.jsx(Ph,{size:15})," ",y?"Filling in…":"Fill in the ticket"]}):t.jsxs("button",{className:"btn pri",disabled:!v.trim()||s.isPending,onClick:le,children:[t.jsx(Tt,{size:15})," Create ticket"]}),t.jsx("button",{className:"btn",onClick:y?()=>void ln():e,children:"Cancel"}),Ms&&!y&&t.jsx(Rk,{onClear:Yn}),t.jsx("span",{className:"grow"}),t.jsx(se,{text:Me})]}),children:[t.jsxs("div",{className:"seg",style:{marginBottom:14,width:"fit-content"},children:[t.jsx("button",{className:a==="write"?"on":"",disabled:y,title:y?"Press Cancel first to write it yourself":void 0,onClick:()=>o("write"),children:"Write it"}),t.jsxs("button",{className:a==="paste"?"on":"",onClick:()=>o("paste"),children:[t.jsx(Ph,{size:13,style:{verticalAlign:"-2px",marginRight:5}}),"From an idea or message"]})]}),a==="paste"?t.jsxs(t.Fragment,{children:[!y&&t.jsx("p",{children:"Paste an idea, a WhatsApp message or one line of business. Add screenshots if you have them. The Analyst fills in the ticket, and you check every field before it is created."}),t.jsxs("div",{className:"field",children:[t.jsx("label",{htmlFor:"nt-paste",children:"The idea or message"}),t.jsx("textarea",{id:"nt-paste",className:"textarea",style:{minHeight:y?70:150},autoFocus:!0,readOnly:y,value:c,onChange:J=>u(J.target.value),onPaste:J=>{J.clipboardData.files.length&&(J.preventDefault(),Ut(J.clipboardData.files))},placeholder:"For example: the manager says clerks should not book more than 3 appointments a day for the same person"})]}),y&&d?t.jsxs(t.Fragment,{children:[De.length>0&&t.jsxs("p",{className:"note",style:{margin:"-6px 0 12px"},children:["With ",De.map(J=>J.name).join(", ")]}),t.jsx(WA,{job:d})]}):t.jsx(rp,{files:De,onAdd:Ut,onRemove:J=>ct(Fe=>Fe.filter((Nt,st)=>st!==J))}),be&&t.jsx(UA,{error:f??(d?.status==="failed"?d.error??"Something went wrong.":null),onRetry:()=>void bn(),onWrite:xt})]}):t.jsxs(t.Fragment,{children:[x?t.jsxs("div",{className:"drafted",children:[t.jsxs("b",{children:[t.jsx(Ph,{size:13})," The Analyst filled this in from your message."]})," Check it and change anything."," ",t.jsx("button",{className:"linkbtn",onClick:cn,children:"Discard this draft"}),x.length>0&&t.jsxs(t.Fragment,{children:[t.jsx("div",{style:{marginTop:6},children:"Still unclear, so the Analyst will ask you after you create it:"}),t.jsx("ul",{children:x.map((J,Fe)=>t.jsx("li",{children:J},Fe))})]})]}):t.jsx("p",{children:$e?"Say what goes wrong and how to see it. The squad finds the cause and fixes it.":"Write it in plain words. Add what you already know; the Analyst asks you about the rest."}),t.jsxs("div",{className:"field",children:[t.jsx("label",{children:"Kind"}),t.jsx("div",{className:"sevs",children:["feature","bug"].map(J=>t.jsxs("button",{className:`choice ${S===J?"on":""}`,onClick:()=>P(J),children:[t.jsx("span",{className:"rd"}),J==="feature"?"New feature":"Bug"]},J))})]}),t.jsxs("div",{className:"field",children:[t.jsx("label",{htmlFor:"nt-title",children:"Title"}),t.jsx("input",{id:"nt-title",className:"input",autoFocus:!0,value:v,onChange:J=>b(J.target.value),placeholder:$e?"For example: A price written as 1,500 is refused":"For example: Show hearing time in local time"})]}),$e?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"field",children:[t.jsx("label",{htmlFor:"nt-what",children:"What happens"}),t.jsx("textarea",{id:"nt-what",className:"textarea",value:ne,onChange:J=>A(J.target.value),placeholder:"For example: the form says the price is not valid."})]}),t.jsx(lc,{label:"Steps to see it",hint:"One step per line, for example: Open Services and add a service.",items:D,onChange:ee,add:"Add a step"}),t.jsxs("div",{className:"field",children:[t.jsx("label",{htmlFor:"nt-expected",children:"What should happen"}),t.jsx("textarea",{id:"nt-expected",className:"textarea",value:z,onChange:J=>me(J.target.value),placeholder:"For example: the price is saved as 1,500 SAR."})]}),t.jsxs("div",{className:"field",children:[t.jsx("label",{htmlFor:"nt-where",children:"Where"}),t.jsx("input",{id:"nt-where",className:"input",value:he,onChange:J=>ke(J.target.value),placeholder:"The page or link, for example: Setup, Services"})]}),t.jsx(rp,{files:De,onAdd:Ut,onRemove:J=>ct(Fe=>Fe.filter((Nt,st)=>st!==J))}),t.jsxs("div",{className:"field",children:[t.jsx("label",{children:"How bad is it?"}),t.jsx("div",{className:"sevs",children:Sj.map(J=>t.jsxs("button",{className:`choice ${Re===J.value?"on":""}`,onClick:()=>Ae(J.value),children:[t.jsx("span",{className:"rd"}),J.label]},J.value))})]})]}):t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"field",children:[t.jsx("label",{htmlFor:"nt-ask",children:"What do you want?"}),t.jsx("textarea",{id:"nt-ask",className:"textarea",value:N,onChange:J=>C(J.target.value),placeholder:"Who needs it, and why. One or two sentences is enough."})]}),t.jsx(lc,{label:"Acceptance criteria",hint:"Each one is something you can check, for example: The clerk sees the time in their own city.",items:Q,onChange:q,add:"Add a criterion"}),t.jsx(lc,{label:"Business rules",hint:"Limits and who may do what, for example: Only a team lead can reassign a case.",items:K,onChange:ce,add:"Add a rule"}),t.jsx(lc,{label:"Edge cases",hint:"Unusual cases to handle, for example: The person has no cases yet.",items:H,onChange:V,add:"Add an edge case"}),t.jsx(rp,{files:De,onAdd:Ut,onRemove:J=>ct(Fe=>Fe.filter((Nt,st)=>st!==J))}),t.jsxs("div",{className:"field",children:[t.jsx("label",{children:"Priority"}),t.jsx("div",{className:"sevs",children:["high","normal","low"].map(J=>t.jsxs("button",{className:`choice ${M===J?"on":""}`,onClick:()=>T(J),children:[t.jsx("span",{className:"rd"}),J==="high"?"High":J==="normal"?"Normal":"Low"]},J))})]})]}),t.jsxs("div",{className:"field",children:[t.jsxs("label",{children:["Track",O&&t.jsxs("span",{className:"note",style:{marginLeft:8,fontWeight:400},children:["The Analyst suggests ",O==="express"?"Express":"Full"]})]}),t.jsx("div",{className:"tracks",children:HA.map(J=>t.jsxs("button",{className:`opt2 ${F===J.id?"pick":""}`,onClick:()=>R(J.id),children:[t.jsxs("b",{children:[J.name,F===J.id&&t.jsxs("span",{children:[t.jsx(xe,{size:13,strokeWidth:2.5})," Chosen"]})]}),J.note]},J.id))})]}),F==="full"&&t.jsxs("label",{className:"talkfirst",children:[t.jsx("input",{type:"checkbox",checked:B,onChange:J=>I(J.target.checked)}),t.jsxs("span",{children:[t.jsx("b",{children:"Talk it through first."})," The Analyst opens a chat instead of sending questions. The spec is written from your talk when you say so."]})]})]})]})}const DA=60;function BA(e){const[n,s]=$.useState(Date.now());return $.useEffect(()=>{const r=setInterval(()=>s(Date.now()),1e3);return()=>clearInterval(r)},[e]),n}function WA({job:e}){const n=BA(!0),s=Math.max(0,Math.floor((n-Date.parse(e.startedAt))/1e3)),a=["read","look","write"].indexOf(e.step),o=d=>d<a?"done":d===a?"now":"todo",c=e.looked.slice(-3),u=e.looked.length-c.length;return t.jsxs("div",{className:"drafting",role:"status","aria-live":"polite",children:[t.jsxs("div",{className:"drafting-head",children:[t.jsx("b",{children:"The Analyst is filling in your ticket"}),t.jsx("span",{className:"grow"}),t.jsxs("span",{className:"mono drafting-clock","aria-label":`${s} seconds so far`,children:[Math.floor(s/60),":",String(s%60).padStart(2,"0")]})]}),t.jsx(sp,{state:o(0),children:"Read your message"}),t.jsxs(sp,{state:o(1),children:["Looking at the project",c.length>0&&t.jsxs("span",{className:"note",children:[": ",c.join(", "),u>0?` and ${u} more`:""]})]}),t.jsx(sp,{state:o(2),children:"Writing the ticket for you to check"}),t.jsxs("p",{className:"note",children:[s>2*DA?"This one is taking longer than usual. You can wait, or press Cancel.":"Usually under a minute."," You can close this window: the draft waits for you under New ticket."]})]})}function sp({state:e,children:n}){return t.jsxs("div",{className:`dstep ${e}`,children:[t.jsx("span",{className:"dot","aria-hidden":"true",children:e==="done"?t.jsx(xe,{size:12,strokeWidth:3}):e==="now"?t.jsx(jn,{size:12,className:"spin"}):null}),t.jsxs("span",{children:[n,t.jsx("span",{className:"sr-only",children:e==="done"?" (done)":e==="now"?" (now)":""})]})]})}function UA({error:e,onRetry:n,onWrite:s}){return e?t.jsx(lm,{title:"The Analyst could not finish",what:e,safe:["Your text and files are kept.","No ticket was made yet."],ways:[{label:"Try again",primary:!0,icon:t.jsx(qr,{size:14}),onClick:n},{label:"Write it myself with what I typed",icon:t.jsx(co,{size:14}),onClick:s}]}):t.jsxs("div",{className:"drafterr calm",role:"status",children:[t.jsx("b",{children:"You stopped the Analyst"}),t.jsx("div",{children:"Nothing was saved. Your text is kept."}),t.jsxs("div",{className:"drafterr-ways",children:[t.jsxs("button",{className:"btn pri",onClick:n,children:[t.jsx(qr,{size:14})," Try again"]}),t.jsxs("button",{className:"btn",onClick:s,children:[t.jsx(co,{size:14})," Write it myself with what I typed"]})]})]})}const HA=[{id:"full",name:"Full",note:"Every step. The Analyst asks questions and you approve the plan."},{id:"express",name:"Express",note:"For a typo or a small urgent fix. No questions, the plan is approved on its own. Build, checks, review and your Looks right still run."}];function lc({label:e,hint:n,items:s,onChange:r,add:a}){const o=(c,u)=>r(s.map((d,p)=>p===c?u:d));return t.jsxs("div",{className:"field",children:[t.jsx("label",{children:e}),s.length===0&&t.jsx("p",{className:"note",style:{margin:"0 0 6px"},children:n}),s.map((c,u)=>t.jsxs("div",{className:"listrow",children:[t.jsx("span",{className:"mono note",children:u+1}),t.jsx("input",{className:"input",value:c,autoFocus:c===""&&u===s.length-1,onChange:d=>o(u,d.target.value),onKeyDown:d=>{d.key==="Enter"&&u===s.length-1&&c.trim()&&r([...s,""])},"aria-label":`${e} ${u+1}`}),t.jsx("button",{className:"iconbtn",onClick:()=>r(s.filter((d,p)=>p!==u)),"aria-label":`Remove ${e.toLowerCase()} ${u+1}`,children:t.jsx(Xe,{size:14})})]},u)),t.jsxs("button",{className:"btn sm",onClick:()=>r([...s,""]),children:[t.jsx(Tt,{size:13})," ",a]})]})}const VA=/\.(ogg|opus|oga|m4a|mp3|wav|aac|amr|flac|weba|mp4|mov|m4v|webm)$/i;function rp({files:e,onAdd:n,onRemove:s}){const[r,a]=$.useState(!1),o=e.some(u=>VA.test(u.name)),c=Pe({queryKey:["speech"],queryFn:()=>Ee("/api/v1/speech"),enabled:o});return t.jsxs("div",{className:"field",children:[t.jsx("label",{children:"Files"}),t.jsxs("label",{className:`dropzone ${r?"over":""}`,onDragOver:u=>{u.preventDefault(),a(!0)},onDragLeave:()=>a(!1),onDrop:u=>{u.preventDefault(),a(!1),u.dataTransfer.files.length&&n(u.dataTransfer.files)},onPaste:u=>u.clipboardData.files.length&&n(u.clipboardData.files),children:[t.jsx(Fc,{size:15})," Drop screenshots, documents, voice or video notes here, or click to pick",t.jsx("input",{type:"file",multiple:!0,hidden:!0,onChange:u=>{u.target.files?.length&&n(u.target.files),u.target.value=""}})]}),e.length>0&&t.jsx("div",{className:"picked",children:e.map((u,d)=>t.jsxs("span",{className:"pickedfile",children:[u.preview?t.jsx("img",{src:u.preview,alt:""}):t.jsx(Fc,{size:13}),t.jsx("span",{className:"mono",children:u.name}),t.jsx("span",{className:"note",children:u.size<1024*1024?`${Math.max(1,Math.round(u.size/1024))} KB`:`${(u.size/1024/1024).toFixed(1)} MB`}),t.jsx("button",{className:"iconbtn",onClick:()=>s(d),"aria-label":`Remove ${u.name}`,children:t.jsx(Xe,{size:13})})]},`${u.name}-${d}`))}),o&&c.data&&t.jsx("p",{className:"note",style:{marginTop:6},children:c.data.hasKey?"squad-kit writes out voice and video notes with Munsit, and takes pictures of the screen in videos, so every agent knows what was said.":"Add a Munsit key in Settings so the squad can listen to voice and video notes. Without it they stay attached, unheard."})]})}function KA({onClose:e,onCreated:n}){const s=pe(),[r,a]=$.useState("AB#"),o=()=>s.mutate({path:"/api/v1/pull",body:{ref:r}},{onSuccess:c=>{n(c),e()}});return t.jsxs(Ve,{title:"Pull from Azure DevOps",onClose:e,icon:t.jsx("span",{className:"glyph",children:t.jsx(ls,{size:15})}),footer:t.jsxs(t.Fragment,{children:[t.jsxs("button",{className:"btn pri",disabled:r.replace(/\D/g,"").length===0||s.isPending,onClick:o,children:[t.jsx(ls,{size:15})," Pull ticket"]}),t.jsx("button",{className:"btn",onClick:e,children:"Cancel"}),t.jsx("span",{className:"grow"}),t.jsx(se,{text:`squad pull ${r.trim()?Hi(r.trim()):"AB#4133"}`})]}),children:[t.jsx("p",{children:"Bring a work item in as a ticket, with its description and attachments."}),t.jsxs("div",{className:"field",children:[t.jsx("label",{htmlFor:"pull-ref",children:"Work item"}),t.jsx("input",{id:"pull-ref",className:"input mono",autoFocus:!0,value:r,onChange:c=>a(c.target.value),onKeyDown:c=>c.key==="Enter"&&o()})]})]})}const Sj=[{value:"stops-work",label:"Stops work"},{value:"annoying",label:"Annoying"},{value:"small",label:"Small"}];function cm({onClose:e,foundIn:n}){const s=pe(),[r,a,o]=we("report-bug","what",""),[c,u,d]=we("report-bug","how",""),[p,f,m]=we("report-bug","expected",""),[y,x]=$.useState("annoying"),k=()=>{o(),d(),m()},v=()=>s.mutate({path:"/api/v1/bugs",body:{what:r,how:c,expected:p,severity:y,foundIn:n},done:"Bug reported. Triage is sorting it."},{onSuccess:()=>{k(),e()}});return t.jsxs(Ve,{title:"Report a bug",onClose:e,icon:t.jsx("span",{className:"glyph",style:{background:"var(--bug-soft)",color:"var(--bug)"},children:t.jsx(Ts,{size:15})}),footer:t.jsxs(t.Fragment,{children:[t.jsxs("button",{className:"btn pri",disabled:!r.trim()||s.isPending,onClick:v,children:[t.jsx(Ts,{size:15})," Report bug"]}),t.jsx("button",{className:"btn",onClick:e,children:"Cancel"}),(r||c||p)&&t.jsx(Rk,{onClear:k}),t.jsx("span",{className:"grow"}),t.jsx(se,{text:`squad bug ${Le(r.trim()||"What happened")}${n?` --in ${n}`:""}`})]}),children:[t.jsxs("p",{children:["It becomes a ticket linked to ",n??"the latest release",", and goes around the same loop. The Tester adds a check so it can't come back."]}),t.jsxs("div",{className:"field",children:[t.jsx("label",{htmlFor:"bug-what",children:"What happened?"}),t.jsx("input",{id:"bug-what",className:"input",autoFocus:!0,value:r,onChange:b=>a(b.target.value),placeholder:"For example: Table text is hard to read in dark mode"})]}),t.jsxs("div",{className:"field",children:[t.jsx("label",{htmlFor:"bug-how",children:"How can we see it?"}),t.jsx("input",{id:"bug-how",className:"input",value:c,onChange:b=>u(b.target.value),placeholder:"The steps, in a line"})]}),t.jsxs("div",{className:"field",children:[t.jsx("label",{htmlFor:"bug-exp",children:"What did you expect?"}),t.jsx("input",{id:"bug-exp",className:"input",value:p,onChange:b=>f(b.target.value)})]}),t.jsxs("div",{className:"field",children:[t.jsx("label",{children:"How bad is it?"}),t.jsx("div",{className:"sevs",children:Sj.map(b=>t.jsxs("button",{className:`choice ${y===b.value?"on":""}`,onClick:()=>x(b.value),children:[t.jsx("span",{className:"rd"}),b.label]},b.value))})]})]})}function YA({release:e,demo:n,onClose:s}){const{toast:r}=qe(),a=()=>void navigator.clipboard?.writeText(e.whatsappDraft??"").then(()=>r("Message copied. Send it from WhatsApp.")),o=[e.addons.changelog&&"Changelog updated",e.addons.tag&&`Tagged ${e.version} in git`,e.addons.pipeline&&"Azure pipeline started"].filter(Boolean);return t.jsxs(Ve,{title:e.unpushed?.length?`${e.version} is made, but not pushed yet`:`${e.version} is released`,onClose:s,icon:t.jsx("span",{className:"glyph",children:t.jsx(Va,{size:15})}),footer:t.jsxs(t.Fragment,{children:[e.addons.whatsapp&&t.jsxs("button",{className:"btn pri",onClick:a,children:[t.jsx(ur,{size:15})," Copy message"]}),t.jsx("button",{className:"btn",onClick:s,children:"Done"})]}),children:[t.jsxs("div",{className:"donelist",children:[e.unpushed?.length?t.jsxs("div",{style:{color:"var(--you-ink)"},children:[t.jsx("span",{style:{width:16,textAlign:"center",fontWeight:800},children:"!"})," The push failed, so its tickets stay open. Press Push again on the release once the remote is reachable."]}):t.jsxs("div",{children:[t.jsx(xe,{size:16})," ",e.tickets.length," tickets released"]}),e.log?e.log.map(c=>t.jsxs("div",{style:c.ok?void 0:{color:"var(--you-ink)"},children:[c.ok?t.jsx(xe,{size:16}):t.jsx("span",{style:{width:16,textAlign:"center",fontWeight:800},children:"!"})," ",c.text]},c.text)):o.map(c=>t.jsxs("div",{children:[t.jsx(xe,{size:16})," ",c]},c))]}),n&&!e.log&&t.jsx("p",{className:"note",style:{marginBottom:12},children:"Demo board: these release steps are shown, not run."}),e.addons.whatsapp&&e.whatsappDraft&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"lbl",style:{marginTop:4},children:"A WhatsApp note for your manager. Copy it and send it yourself."}),t.jsx("div",{className:"wa",children:e.whatsappDraft})]})]})}function Ps(e){return e.stage==="release"||e.stage==="done"}function wu(e){return Ps(e)||!!e.specApproved||["implement","test","review"].includes(e.stage)}function QA(e){return e.part==="story"?"The story":e.index===void 0?"New done when":`Done when ${e.index+1}`}function ef(e){return e.length>1?`${e.slice(0,-1).join(", ")} and ${e.at(-1)}`:String(e[0]??"")}function Py({parts:e}){return t.jsx("div",{className:"changeparts",children:e.map((n,s)=>t.jsxs("div",{className:"chrow",children:[t.jsx("div",{className:"chlabel",children:QA(n)}),t.jsx("div",{className:n.before?"chold":"chold empty",children:n.before||t.jsx("i",{children:"new"})}),t.jsx("div",{className:"chnew",children:n.after||t.jsx("i",{children:"removed"})})]},s))})}const Ry={same:"Stays",changed:"Redone",new:"New"};function GA({c:e}){const n=e.design,s=n.before.filter(a=>!n.steps.some(o=>o.title===a)),r=n.steps.flatMap((a,o)=>a.change==="same"?[o+1]:[]);return t.jsxs("div",{className:"changeparts",children:[r.length>0&&t.jsxs("div",{className:"chrow",children:[t.jsxs("div",{className:"chlabel",children:[r.length===1?"Step":"Steps"," ",ef(r)]}),t.jsx("div",{children:t.jsx("span",{className:"pill wait",children:Ry.same})}),t.jsx("div",{className:"chnew note",children:"Built already, as they are."})]}),n.steps.map((a,o)=>a.change==="same"?null:t.jsxs("div",{className:"chrow",children:[t.jsxs("div",{className:"chlabel",children:["Step ",o+1]}),t.jsx("div",{children:t.jsx("span",{className:"pill you",children:Ry[a.change]})}),t.jsx("div",{className:"chnew",children:a.title})]},o)),s.map(a=>t.jsxs("div",{className:"chrow",children:[t.jsx("div",{className:"chlabel",children:"Dropped"}),t.jsx("div",{}),t.jsx("div",{className:"chold",children:a})]},a))]})}function ZA(e,n){const s=!!e.sessions?.build;return n.size==="big"?s?"Approve, and the Builder pauses after its current step. The Architect updates the design and you approve that too. Then the Builder redoes only the steps the change touches.":e.steps?"Approve, and the spec says it now. The Architect updates the design, and you approve it as usual.":"Approve, and the spec says it now. The Architect designs from the new spec.":s?"Approve, and the spec says it now. The Builder gets it at the end of its current step; the work does not stop.":"Approve, and the spec says it now. The Builder builds from the new spec."}function XA({t:e}){const n=pe(),[s,r]=$.useState(!1),[a,o]=$.useState(!1),[c,u,d]=we(e.id,"change-reason",""),p=Vr(e);if(!p)return null;const f=p.status==="approved"||p.status==="designing",m=p.status==="writing"||p.status==="designing"||p.status==="building",y=(e.steps??[]).flatMap((v,b)=>v.status==="done"?[]:[b+1]),x={writing:`Change ${p.id}: the Analyst is writing it into the spec`,failed:`Change ${p.id}: the Analyst could not write it`,proposed:`Change ${p.id} to the spec`,approved:`Change ${p.id} is approved`,designing:`Change ${p.id}: the Architect is updating the design`,"design-ready":`The design update for change ${p.id}`,building:p.size==="big"?`Change ${p.id}: the Builder is redoing ${y.length===1?"step":"steps"} ${ef(y)}`:`Change ${p.id}: the Builder is making it`,done:"",declined:""}[p.status],k=(v,b,N)=>n.mutate({path:`/api/v1/tickets/${e.id}/spec-change/${v}`,body:N,done:b},{onSuccess:()=>{r(!1),o(!1),d()}});return t.jsx("div",{className:"outdated","aria-label":"Change to the spec",children:t.jsxs("div",{className:"outdated-item changecard",children:[t.jsxs("div",{className:"outdated-head",children:[t.jsx("span",{className:"ic",children:m?t.jsx(jn,{size:15,className:"spin"}):p.status==="failed"?t.jsx(dr,{size:15}):t.jsx(cs,{size:15})}),t.jsx("b",{children:x}),p.size&&t.jsx("span",{className:`pill ${p.size==="big"?"you":"wait"}`,children:p.size==="big"?"Big change":"Small change"})]}),t.jsxs("div",{className:"changebody",children:[p.summary?t.jsx("p",{children:p.summary}):t.jsxs("p",{children:["“",p.ask,"”"]}),p.status==="writing"&&t.jsx("p",{className:"note",children:"The work goes on meanwhile. Nothing changes until you approve it."}),p.status==="failed"&&t.jsx("p",{className:"note",children:p.error}),p.why&&(p.status==="proposed"||p.status==="approved")&&t.jsx("p",{className:"note",children:p.why}),p.status==="proposed"&&p.parts&&t.jsx(Py,{parts:p.parts}),p.status==="proposed"&&t.jsx("p",{className:"note",children:ZA(e,p)}),p.status==="approved"&&t.jsx("p",{className:"note",children:p.size==="big"?"The Builder finishes its current step, then pauses while the Architect updates the design.":"It reaches the Builder at the end of its current step. The work goes on."}),p.status==="designing"&&t.jsx("p",{className:"note",children:"The Builder paused after its step. The design update comes to you next."}),p.status==="design-ready"&&p.design&&t.jsxs(t.Fragment,{children:[p.design.summary&&t.jsx("p",{children:p.design.summary}),t.jsx(GA,{c:p}),p.parts&&t.jsxs(t.Fragment,{children:[t.jsx("p",{className:"note",children:"And the spec, as you approved it:"}),t.jsx(Py,{parts:p.parts})]}),t.jsxs("p",{className:"note",children:["Approve, and the Builder redoes only ",(()=>{const v=p.design.steps.flatMap((b,N)=>b.change==="same"?[]:[N+1]);return v.length?`${v.length===1?"step":"steps"} ${ef(v)}`:"what changed"})(),". Decline, and the spec stays as it was; the Builder carries on."]})]})]}),a?t.jsxs("div",{className:"row",children:[t.jsx("input",{className:"input",autoFocus:!0,value:c,onChange:v=>u(v.target.value),placeholder:"Why take it back? (optional, it stays in the spec's record)"}),t.jsx("button",{className:"btn sm",disabled:n.isPending,onClick:()=>k("withdraw","Withdrawn. The spec is back to how it was.",{reason:c}),children:"Withdraw"}),t.jsx("button",{className:"btn sm quiet",onClick:()=>o(!1),children:"Cancel"})]}):f?t.jsxs("div",{className:"row",children:[t.jsx("button",{className:"btn sm",disabled:n.isPending,onClick:()=>o(!0),children:"Withdraw change"}),t.jsx("span",{className:"grow"}),t.jsx(se,{text:`squad propose ${e.id} --withdraw`})]}):s?t.jsxs("div",{className:"row",children:[t.jsx("input",{className:"input",autoFocus:!0,value:c,onChange:v=>u(v.target.value),placeholder:"Why not? (optional, it stays in the spec's record)"}),t.jsx("button",{className:"btn sm",disabled:n.isPending,onClick:()=>k("decline","Declined. Nothing changes.",{reason:c}),children:"Decline"}),t.jsx("button",{className:"btn sm quiet",onClick:()=>r(!1),children:"Cancel"})]}):p.status==="proposed"||p.status==="design-ready"?t.jsxs("div",{className:"row",children:[t.jsxs("button",{className:"btn sm pri",disabled:n.isPending,onClick:()=>k("approve",p.status==="design-ready"?"Approved. The Builder redoes what changed.":p.size==="big"?"Approved. The Architect updates the design next.":"Approved. The spec says it now."),children:[t.jsx(xe,{size:14,strokeWidth:2.5})," ",p.status==="design-ready"?"Approve the new design":"Approve"]}),t.jsx("button",{className:"btn sm",onClick:()=>r(!0),children:p.status==="design-ready"?"Decline the change":"Decline"}),t.jsx("span",{className:"grow"}),t.jsx(se,{text:p.status==="design-ready"?`squad approve ${e.id}`:`squad propose ${e.id} --approve`})]}):p.status==="failed"?t.jsxs("div",{className:"row",children:[t.jsx("button",{className:"btn sm pri",disabled:n.isPending,onClick:()=>k("retry","The Analyst writes it again."),children:"Try again"}),t.jsx("button",{className:"btn sm",disabled:n.isPending,onClick:()=>k("decline","Dropped the change."),children:"Drop it"}),t.jsx("span",{className:"grow"}),t.jsx(se,{text:`squad propose ${e.id} --retry`})]}):null]})})}function Bo({t:e,initial:n="",from:s,onClose:r}){const a=pe(),[o,c,u]=we(e.id,"propose",n),d=Ps(e),p=Vr(e),f=()=>{u(),r()},m=!!o.trim()&&!a.isPending,y=Le(o.trim()||"…"),x=k=>a.mutate({path:`/api/v1/tickets/${e.id}/spec-change/new-ticket`,body:{text:o,as:k},done:k==="bug"?`Reported a bug, linked to ${e.id}.`:`Made a new ticket, linked to ${e.id}.`},{onSuccess:f});return t.jsxs(Ve,{title:d?"Ask for a change":"Propose a change",icon:t.jsx(cs,{size:16}),onClose:r,footer:t.jsxs(t.Fragment,{children:[d?t.jsxs(t.Fragment,{children:[t.jsxs("button",{className:"btn pri",disabled:!m,onClick:()=>x("ticket"),children:[t.jsx(Tt,{size:15})," Make a new linked ticket"]}),t.jsxs("button",{className:"btn",disabled:!m,onClick:()=>x("bug"),children:[t.jsx(Ts,{size:15})," Report a bug"]})]}):t.jsxs("button",{className:"btn pri",disabled:!m||!!p,onClick:()=>a.mutate({path:`/api/v1/tickets/${e.id}/spec-change`,body:{text:o,...s?{from:s}:{}},done:"Proposed. The Analyst writes it into the spec; the work goes on."},{onSuccess:f}),children:[t.jsx(cs,{size:15})," Propose"]}),t.jsx("span",{className:"grow"}),t.jsx(se,{text:d?`squad propose ${e.id} --as ticket ${y}`:`squad propose ${e.id} ${y}`})]}),children:[t.jsx("p",{className:"note",style:{marginBottom:10},children:d?`${e.id} is ${e.stage==="done"?"released":"accepted"}${e.release?` (${e.release})`:""}, so it only answers questions. Your change becomes a new ticket linked to it, or a bug report.`:p?`Change ${p.id} is still open. One change at a time: approve or decline it first.`:"Say what should change. The Analyst writes it into the spec, old and new, and says if it is small or big. Nothing changes until you approve it, and the work goes on meanwhile."}),t.jsx("textarea",{className:"input",rows:4,style:{width:"100%"},autoFocus:!0,value:o,onChange:k=>c(k.target.value),placeholder:"For example: allow 5 bookings a day, not 3"})]})}function JA({t:e}){const[n,s]=$.useState(!1);return wu(e)?t.jsxs(t.Fragment,{children:[t.jsxs("button",{className:"btn sm",onClick:()=>s(!0),title:Ps(e)?"Becomes a new linked ticket or a bug report":"The Analyst writes it into the spec; you approve it",children:[t.jsx(cs,{size:13})," ",Ps(e)?"Ask for a change":"Propose a change"]}),n&&t.jsx(Bo,{t:e,onClose:()=>s(!1)})]}):null}const eP={writing:"Being written",proposed:"Waits for you",approved:"Approved",designing:"Design update","design-ready":"Waits for you",building:"Being built",done:"In the spec",declined:"Declined",failed:"Not written"};function tP({t:e}){const n=[...e.changes??[]].reverse();return n.length?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"lbl",children:["Changes to the spec · ",n.length]}),t.jsx("ul",{className:"ticketnotes",children:n.map(s=>t.jsxs("li",{children:[t.jsx("span",{className:`pill ${s.status==="done"?"ok":s.status==="declined"?"wait":"you"}`,children:s.decided?.withdrawn?"Withdrawn":eP[s.status]}),t.jsxs("span",{className:"grow",children:[s.id,": ",s.summary??s.ask,s.size?` (${s.size})`:"",s.decided?.reason?`. Why not: ${s.decided.reason}`:""]}),t.jsx("span",{className:"note",children:s.by})]},s.id))})]}):null}function um(e){return!e.takenOver&&["implement","test","review"].includes(e.stage)}function dm({t:e}){const n=pe();return t.jsxs("button",{className:"btn sm",disabled:n.isPending,title:"The squad stops. You work in the Builder's Claude Code session, then give it back.",onClick:()=>n.mutate({path:`/api/v1/tickets/${e.id}/take-over`,done:"It is yours. The squad waits until you give it back."}),children:[t.jsx($o,{size:12})," Take over"]})}function Wo(e){const n=e.waiting?.kind;if(n==="proof")return!0;if(n!=="stuck")return!1;const s=e.stuck?.gate;return s==="checks"||s==="review"||s==="proof"||s==="merge"||e.stage==="test"||e.stage==="review"}function Br(e){const n=e.page?.trim()??"";if(!n)return"";const s=n.replace(/^[a-z]+:\/\/[^/]+/i,"");return s.startsWith("/")?s:`/${s}`}function Yc(e){return[...new Set([e,...e.more??[]].map(Br).filter(Boolean))]}function nP(e){return[...new Set((e.proof??[]).flatMap(Yc))]}const sP={analyst:"intake",builder:"build",tester:"tester"},rP=new Set(["implement","test","review","release","done"]),iP="Next in line";function aP(e,n=!0){const s=e.proof?.length?"tester":e.sessions?.build||rP.has(e.stage)?"builder":"analyst";return s==="analyst"||!n||e.sessions?.[sP[s]]?s:"analyst"}function Cj(e){return!e.waiting&&(e.status??"").startsWith(iP)}function oP(e){return!!(e.live||e.squad)&&!e.waiting&&!e.takenOver&&!Cj(e)}const lP={architect:"Architect",builder:"Builder",reviewer:"Reviewer"},cP={tickets:"is being read",specs:"is being planned",implement:"is being built",test:"is being checked",review:"is being reviewed",release:"is accepted",bugs:"is being looked into",done:"is released"};function uP(e){const n=e.id;if(e.stage==="done")return`${n} is released${e.release?` in ${e.release}`:""}`;if(e.stage==="release")return`${n} is accepted${e.release?` and goes out in ${e.release}`:""}`;if(e.takenOver)return`You have ${n}, and the squad waits until you give it back`;const s=(e.dependsOn?.length?e.dependsOn:e.dependency?.on??[]).join(", ");switch(e.waiting?.kind){case"proof":return`${n} waits for your check`;case"stuck":return Wo(e)?`${n} stopped at a check and waits for your decision`:`${n} stopped and waits for your decision`;case"ask":return`${n} waits for your answer to the ${e.agentQuestion?lP[e.agentQuestion.from]:"squad"}'s question`;case"depends":return`${n} waits for ${s||"another story"} to be merged`;case"questions":return`${n} waits for your answers to the questions`;case"spec":return`${n}'s spec waits for your approval`;case"plan":return`${n}'s design waits for your approval`;case"change":return`${n} waits for you to decide on the design update`;case"release":return`${n} waits for you to release it`;case"chat":return`${n} waits while you talk it through`;case"yours":return`You have ${n}, and the squad waits until you give it back`}return e.dependency?.way==="wait"&&!e.dependency.started&&!e.squad?`${n} waits for ${s||"another story"} to be merged`:Cj(e)?`${n} waits in the queue`:e.live||e.squad?`${n} ${cP[e.stage]}`:e.stage==="tickets"||e.stage==="bugs"?`${n} has not started yet`:`${n} is not running right now`}const at={analyst:"Analyst",architect:"Architect",builder:"Builder",reviewer:"Reviewer",tester:"Tester"},Iy={analyst:"intake",architect:"intake",builder:"build",reviewer:"review",tester:"tester"},dP={analyst:Ui,architect:dk,builder:$o,reviewer:fk,tester:bk},hP={"analyst-read":"analyst",triage:"analyst","spec-rewrite":"analyst","chat-spec":"analyst","plan-write":"architect","plan-rewrite":"architect","answered-architect":"architect","chat-design":"architect",build:"builder",unstick:"builder",fix:"builder",test:"builder","review-fix":"builder","restore-tests":"builder","update-base":"builder","proof-fix":"builder","answered-builder":"builder","chat-carry-builder":"builder",review:"reviewer","answered-reviewer":"reviewer","chat-carry-reviewer":"reviewer",proof:"tester","chat-carry-tester":"tester"};function An({role:e,small:n,live:s}){const r=dP[e]??Ui;return t.jsx("span",{className:`cav av-${e} ${n?"sm":""} ${s?"live":""}`,"aria-hidden":"true",children:t.jsx(r,{size:n?13:16,strokeWidth:2})})}function Zr({t:e,agent:n,label:s,primary:r,small:a}){const o=pe();return t.jsxs("button",{className:`btn ${r?"pri":""} ${a?"sm":""}`,disabled:o.isPending,onClick:()=>o.mutate({path:`/api/v1/tickets/${e.id}/chat/start`,body:{with:n}},{onSuccess:()=>rs.show(e.id)}),children:[t.jsx(Pn,{size:14})," ",s??`Talk to the ${at[n]}`]})}function pP(e){return e.live&&e.squad?.phase?hP[e.squad.phase]??null:null}function $j(e){if(e.stage==="done")return{text:`Released${e.release?` · ${e.release}`:""}`,tone:"done"};if(e.stage==="release")return{text:`Accepted${e.release?` · ready for ${e.release}`:""}`,tone:"done"};const n=As[e.stage];return e.chat?.open&&!e.chat.beside?{text:`${n} · ${e.chat.thinking?"talking":"your turn"}`,tone:"you"}:e.waiting?{text:`${n} · your turn`,tone:"you"}:{text:`${n}${e.live?" · working":""}`,tone:e.live?"work":"you"}}function Ej(e){const n=e.chat,s=at[n.with];return n.beside?Ps(e)?{kind:"released",note:"Questions only"}:Wo(e)?{kind:"review",note:"Questions only"}:{kind:oP(e)?"working":"still",note:"Questions only"}:{kind:"talk",note:`The ${s} waits while you talk`}}function Tj(e){const n=e.chat,s=at[n.with];return n.beside?null:n.with==="analyst"?{label:`${e.story?"Update":"Write"} the spec`,path:"write",done:`The Analyst is ${e.story?"updating":"writing"} the spec from your talk.`}:n.with==="architect"&&e.specApproved?{label:`${e.steps?"Update":"Write"} the design`,path:"write",done:`The Architect is ${e.steps?"updating":"writing"} the design from your talk.`}:n.with==="architect"?null:{label:"Back to work",path:"done",done:`The ${s} carries on as you agreed.`}}function fP({t:e,size:n,onFull:s,onPanel:r}){const a=pe(),[o,c]=$.useState(!1),u=e.chat,d=at[u.with],p=Ej(e),f=$j(e),m=u.open?Tj(e):null,y=a.isPending||!!u.thinking,x=u.with==="builder"||u.with==="reviewer"||u.with==="tester",k=(S,P)=>a.mutate({path:`/api/v1/tickets/${e.id}/chat/${S}`,done:P}),v=t.jsxs(t.Fragment,{children:[u.open&&m&&t.jsxs("button",{className:"btn pri",disabled:y,onClick:()=>k(m.path,m.done),children:[t.jsx(xe,{size:15,strokeWidth:2.5})," ",m.label]}),u.open&&p.kind==="talk"&&!x&&t.jsx("button",{className:"btn",disabled:y,onClick:()=>k("done","Done talking."),children:m?"Done, no changes":"Done"}),u.open&&p.kind==="talk"&&x&&um(e)&&t.jsx(dm,{t:e}),u.open&&p.kind==="released"&&t.jsxs(t.Fragment,{children:[t.jsxs("button",{className:"btn",onClick:()=>c(!0),children:[t.jsx(gx,{size:14})," New linked ticket"]}),t.jsxs("button",{className:"btn",onClick:()=>c(!0),children:[t.jsx(Ts,{size:14})," Report a bug"]})]}),u.open&&p.kind==="working"&&wu(e)&&t.jsxs("button",{className:"btn",onClick:()=>c(!0),children:[t.jsx(cs,{size:14})," Propose a change"]}),u.open&&p.kind!=="talk"&&t.jsx("button",{className:"btn",disabled:a.isPending,onClick:()=>k("done",`Done asking the ${d}.`),children:"Done"}),!u.open&&(u.beside||!e.takenOver)&&t.jsxs("button",{className:"btn",disabled:a.isPending,onClick:()=>a.mutate({path:`/api/v1/tickets/${e.id}/chat/start`,body:{with:u.with,...u.beside?{ask:!0}:{}}},{onSuccess:()=>rs.show(e.id)}),children:[t.jsx(Pn,{size:14})," ",u.beside?`Ask the ${d} again`:`Talk to the ${d} again`]})]}),b=u.beside?uP(e):"",N=u.open&&p.kind==="working"?t.jsxs("div",{className:"cbanner work",children:[t.jsx("span",{className:"livedot","aria-hidden":"true"}),t.jsxs("span",{children:[t.jsx("b",{children:b}),e.status?t.jsxs(t.Fragment,{children:[" · ",e.status]}):null,". Asking never stops the work; a change goes through the spec."]})]}):u.open&&p.kind==="review"?t.jsx("div",{className:"cbanner done",children:t.jsxs("span",{children:[t.jsxs("b",{children:[b,"."]})," Your questions change nothing on it."," ",e.waiting?.kind==="proof"?"To ask for a change, press Something's wrong.":"To go on, pick a way out on its card."]})}):u.open&&p.kind==="released"?t.jsx("div",{className:"cbanner done",children:t.jsxs("span",{children:[t.jsxs("b",{children:[b,"."]})," Ask anything about it. A change becomes a new linked ticket or a bug report."]})}):u.open&&p.kind==="still"?t.jsx("div",{className:"cbanner done",children:t.jsxs("span",{children:[t.jsxs("b",{children:[b,"."]})," Your questions change nothing on it."]})}):null,C=o?t.jsx(Bo,{t:e,from:u.with,onClose:()=>c(!1)}):null;return n==="phone"?t.jsxs("div",{className:"chead-m",children:[t.jsxs("div",{className:"chead-m-row",children:[t.jsx("span",{className:"ctitle",children:e.title}),u.open&&m&&t.jsx("button",{className:"btn pri sm",disabled:y,onClick:()=>k(m.path,m.done),children:m.label}),u.open&&!m&&t.jsx("button",{className:"btn sm",disabled:a.isPending,onClick:()=>k("done","Done talking."),children:"Done"})]}),N,u.open&&p.kind==="released"&&t.jsxs("div",{className:"chead-m-row",children:[t.jsxs("button",{className:"btn sm",onClick:()=>c(!0),children:[t.jsx(gx,{size:13})," New linked ticket"]}),t.jsxs("button",{className:"btn sm",onClick:()=>c(!0),children:[t.jsx(Ts,{size:13})," Report a bug"]})]}),C]}):n==="full"?t.jsxs("div",{className:"chead-f",children:[t.jsxs("div",{className:"chead-f-row",children:[t.jsx(An,{role:u.with,live:u.thinking}),t.jsxs("div",{className:"chead-f-t",children:[t.jsxs("div",{className:"chead-line",children:[t.jsx("span",{className:"cid",children:e.id}),t.jsx("span",{className:`cstage ${f.tone}`,children:f.text}),u.open&&t.jsx("span",{className:"cnote",children:p.note})]}),t.jsx("div",{className:"ctitle",children:e.title})]}),t.jsx("span",{className:"grow"}),t.jsx("div",{className:"cbtns",children:v}),r&&t.jsx("button",{className:"iconbtn",onClick:r,"aria-label":"Back to the side panel",title:"Back to the side panel",children:t.jsx(vk,{size:16})})]}),N,C]}):t.jsxs("div",{className:"chead-p",children:[t.jsxs("div",{className:"chead-line",children:[t.jsx("span",{className:"cid",children:e.id}),t.jsx("span",{className:`cstage ${f.tone}`,children:f.text}),t.jsx("span",{className:"grow"}),u.open&&t.jsx("span",{className:"cnote",children:p.note}),s&&t.jsx("button",{className:"iconbtn sm",onClick:s,"aria-label":"Open full screen",title:"Full screen",children:t.jsx(cu,{size:14})})]}),t.jsx("div",{className:"ctitle",children:e.title}),N,t.jsx("div",{className:"cbtns",children:v}),C]})}const cc=e=>`${e.at}|${e.who}`,zy=e=>e.who!=="you"&&e.who!=="squad";function hm({id:e,size:n,onOpenDoc:s,onFull:r,onPanel:a}){const o=Ro(e),c=o.data,u=c?.chat,d=$.useRef(null),[p,f]=we(e,"chat",""),m=$.useRef(null),y=$.useRef(null),[x,k]=$.useState(null),v=c?.chat?.messages.length??0;$.useEffect(()=>{x&&v>x.count&&k(null)},[v,x]);const b=u?u.beside?"chat":Iy[u.with]:"",N=Pe({queryKey:["conversation",e,b],queryFn:()=>Ee(`/api/v1/tickets/${e}/conversations/${b}`),enabled:!!(u&&(u.beside?u.side:c?.sessions?.[Iy[u.with]])),refetchInterval:u?.thinking?1500:8e3,retry:!1}),C=$.useMemo(()=>jj(N.data?.updates??[]).filter(V=>V.kind==="tool"),[N.data]),S=(V,ne)=>C.filter(A=>(!V||(A.at??"")>=V)&&(!ne||(A.at??"")<=ne)),P=$.useRef(null),[M,T]=$.useState(null),F=$.useMemo(()=>u?.messages??[],[u?.messages]);$.useEffect(()=>{if(!u)return;const V=F.map(cc);if(!P.current){P.current=new Set(V);return}const ne=F.filter(D=>!P.current.has(cc(D)));for(const D of V)P.current.add(D);const A=ne.filter(zy).at(-1);A&&T({key:cc(A),shown:0,total:T7(A.text)})},[u,F]),$.useEffect(()=>{if(!M)return;if(M.shown>=M.total){T(null);return}const V=Math.max(1,Math.ceil(M.total/120)),ne=setTimeout(()=>T(A=>A&&{...A,shown:A.shown+V}),55);return()=>clearTimeout(ne)},[M]);const R=$.useRef(!0),B=$.useRef(null);if($.useLayoutEffect(()=>{const V=d.current;V&&R.current&&(V.scrollTop=V.scrollHeight)}),$.useEffect(()=>{const V=d.current,ne=B.current;if(!V||!ne)return;const A=new ResizeObserver(()=>{R.current&&(V.scrollTop=V.scrollHeight)});return A.observe(ne),()=>A.disconnect()},[c?.id,!!u]),$.useEffect(()=>{u&&rs.seen(e,F.length)},[u,e,F.length]),!c)return t.jsx("div",{className:"cempty",children:o.isError?`No ticket ${e}.`:"Loading…"});if(!u)return t.jsxs("div",{className:"cempty",children:[t.jsxs("p",{children:["No talk on ",c.id," yet."]}),t.jsx(Zr,{t:c,agent:"analyst",primary:!0})]});const I=at[u.with],O=Ej(c),_=[...F].reverse().find(V=>V.who==="you"),Q=Tj(c),q=pP(c),K=O.kind==="working"?`You are asking the ${I}. ${q?`The ${at[q]}`:"The squad"} keeps working on ${c.id}, and this talk changes nothing.`:O.kind==="review"||O.kind==="still"?`You are asking the ${I} about ${c.id}. It stays where it is, and this talk changes nothing.`:O.kind==="released"?`${c.id} is ${c.stage==="done"?"released":"accepted"}. Ask the ${I} anything about it.`:`You started talking with the ${I}. Its work on ${c.id} waits until you press ${Q?Q.label:"Done"}${Q&&Q.label!=="Back to work"?" or Done":""}.`,ce=[...F].reverse().find(zy),H=V=>{V!==void 0&&f(V),setTimeout(()=>m.current?.focus(),0)};return t.jsxs("div",{className:`chat-v csize-${n}`,children:[t.jsx(fP,{t:c,size:n,onFull:r,onPanel:a}),t.jsx("div",{className:"cthread",ref:d,"aria-live":"polite",onScroll:V=>{const ne=V.currentTarget;R.current=ne.scrollHeight-ne.scrollTop-ne.clientHeight<80},children:t.jsxs("div",{className:"ccol",ref:B,children:[u.open&&t.jsx("div",{className:"cnote-pill",children:K}),F.map((V,ne)=>{if(V.who==="squad")return t.jsx(wP,{t:c,m:V,last:ne===F.length-1,onAsk:()=>H()},ne);if(V.who==="you")return t.jsx(xP,{t:c,m:V,onOpenDoc:s,onReply:z=>H(z)},ne);const A=F[ne-1],D=M?.key===cc(V),ee=F[ne+1];return t.jsx(yP,{t:c,m:V,size:n,used:S(A?.at,V.at),writing:D?M.shown:null,answer:ee?.who==="you"?ee.text:void 0,canChoose:u.open&&!u.thinking&&V===ce&&ne===F.length-1,newest:V===ce,onChoose:z=>y.current?.(z),onOther:()=>H(),onOpenDoc:s,onReply:z=>H(z)},ne)}),x&&t.jsx(mP,{p:x}),u.thinking&&F.at(-1)?.note!=="waits"&&t.jsx(bP,{role:u.with,steps:S(_?.at??F.at(-1)?.at),hasMessage:!!_})]})}),u.open?t.jsx(NP,{t:c,size:n,text:p,setText:f,input:m,onSent:()=>R.current=!0,sendRef:y,setPending:k}):t.jsx("div",{className:"cclosed",children:"This talk is over. It stays here to read."})]})}function mP({p:e}){const n=In(e.text);return t.jsxs("div",{className:"cyou cmsg",children:[t.jsxs("div",{className:"cybub",children:[e.files.length>0&&t.jsx("div",{className:"cup",children:e.files.map((s,r)=>t.jsxs("div",{className:"cup-row",children:[s.preview?t.jsx("img",{className:"cup-img",src:s.preview,alt:""}):t.jsx("span",{className:"cfic sm file",children:(s.name.split(".").pop()??"").toUpperCase().slice(0,4)}),t.jsx("span",{className:"cfname",children:s.name}),t.jsx("span",{className:"cbar",children:t.jsx("i",{})})]},r))}),e.text.trim()&&t.jsx("p",{className:Is(n),dir:n.dir,lang:n.dir==="rtl"?"ar":"en",children:e.text})]}),t.jsx("span",{className:"cmeta",children:"You · now · sending"})]})}function Aj({t:e,m:n,holder:s,onReply:r}){const a=pe(),{toast:o}=qe(),[c,u]=$.useState(!1),[d,p]=$.useState(!1),f=()=>{const k=window.getSelection();return((k&&!k.isCollapsed&&s.current?.contains(k.anchorNode)?k.toString().trim():"")||n.text).trim().slice(0,2e3)},m=(k,v)=>{u(!1),a.mutate({path:`/api/v1/tickets/${e.id}/notes`,body:{text:f(),kind:k},done:`Added to the spec as ${v}.`})},y=()=>void navigator.clipboard?.writeText(n.text).then(()=>o("Copied"),()=>o("Could not copy. Select the text instead.","err")),x=()=>r(`> ${n.text.replace(/\s+/g," ").slice(0,160)}${n.text.length>160?"…":""}
615
-
616
- `);return t.jsxs("div",{className:"cacts",children:[t.jsxs("button",{className:"cact",onClick:y,children:[t.jsx(ur,{size:13})," Copy"]}),n.who==="you"&&n.text.trim()&&wu(e)&&t.jsxs("button",{className:"cact",onClick:()=>p(!0),children:[t.jsx(cs,{size:13})," Propose as a change"]}),!Ps(e)&&n.text.trim()&&t.jsxs("span",{className:"cmenu-w",children:[t.jsxs("button",{className:"cact",onClick:()=>u(!c),"aria-haspopup":"menu","aria-expanded":c,onMouseDown:k=>k.preventDefault(),children:[t.jsx(Tt,{size:13})," Add to spec"]}),c&&t.jsxs("div",{className:"cmenu",role:"menu",onMouseLeave:()=>u(!1),children:[t.jsxs("button",{role:"menuitem",onClick:()=>m("rule","a business rule"),onMouseDown:k=>k.preventDefault(),children:[t.jsx("b",{children:"A business rule"}),t.jsx("small",{children:"Every agent must follow it"})]}),t.jsxs("button",{role:"menuitem",onClick:()=>m("criterion",'a "done when" item'),onMouseDown:k=>k.preventDefault(),children:[t.jsx("b",{children:'A "done when" item'}),t.jsx("small",{children:"The Tester proves it with a screenshot"})]}),t.jsxs("button",{role:"menuitem",onClick:()=>m("note","a note"),onMouseDown:k=>k.preventDefault(),children:[t.jsx("b",{children:"A note"}),t.jsx("small",{children:"Context for the next steps"})]})]})]}),e.chat?.open&&t.jsxs("button",{className:"cact",onClick:x,children:[t.jsx(G6,{size:13})," Reply"]}),d&&t.jsx(Bo,{t:e,initial:n.text,from:e.chat?.with,onClose:()=>p(!1)})]})}function gP(e){let n=!1;return e.split(`
617
- `).map((s,r,a)=>{/^\s*```/.test(s)&&(n=!n);const o=a[r+1]??"";return!n&&s.trim()&&o.trim()&&!/^\s*([-*+]|\d+\.|>|```)\s/.test(o)?`${s}
618
- `:s}).join(`
619
- `)}function xP({t:e,m:n,onOpenDoc:s,onReply:r}){const a=$.useRef(null),[o,c]=$.useState(!1),u=!n.text.trim()&&(n.files??[]).some(d=>Jp.test(d));return t.jsxs("div",{className:`cyou cmsg ${o?"picked":""}`,children:[t.jsxs("div",{className:"cybub",ref:a,onClick:()=>c(!o),children:[n.text.trim()&&t.jsx(mo,{text:gP(n.text),ticket:e.id}),n.files&&n.files.length>0&&t.jsx(am,{ticket:e.id,files:n.files,onOpen:s,sent:!0,from:"From you"})]}),t.jsxs("span",{className:"cmeta",children:["You · ",jc(n.at),u?" · written out from your voice":""]}),t.jsx(Aj,{t:e,m:n,holder:a,onReply:r})]})}function jc(e){return new Date(e).toDateString()===new Date().toDateString()?Rn(e):`${Rs(e)} ${Rn(e)}`}function yP({t:e,m:n,size:s,used:r,writing:a,answer:o,canChoose:c,newest:u,onChoose:d,onOther:p,onOpenDoc:f,onReply:m}){const y=$.useRef(null),[x,k]=$.useState(!1),v=n.who,b=at[v]??"Agent",N=a!==null,C=N?E7(n.text,a):n.text,S=t.jsx(mo,{text:C,ticket:e.id,stream:N,caret:N});return t.jsxs("div",{className:`cag cmsg ag-${v} ${x?"picked":""}`,children:[t.jsx(An,{role:v,live:N}),t.jsxs("div",{className:"cwho",children:[t.jsx("b",{children:b}),N?t.jsx("span",{className:"shim",children:"Writing"}):t.jsx("span",{className:"ctime",children:jc(n.at)})]}),t.jsxs("div",{className:"cagb",ref:y,onClick:P=>s==="phone"&&!P.target.closest("button, a")&&k(!x),children:[r.length>0&&t.jsx(jP,{steps:r}),N||u?S:t.jsx(gA,{lines:xA(n.text),children:S}),!N&&n.files&&n.files.length>0&&t.jsx(am,{ticket:e.id,files:n.files,onOpen:f,from:`From the ${b} · ${jc(n.at)}`}),!N&&n.options&&n.options.length>0&&t.jsx(kP,{options:n.options,answer:o,can:c,onChoose:d,onOther:p})]}),!N&&s==="phone"&&t.jsxs("span",{className:"cmeta",children:[b," · ",jc(n.at)]}),!N&&t.jsx(Aj,{t:e,m:n,holder:y,onReply:m})]})}function kP({options:e,answer:n,can:s,onChoose:r,onOther:a}){const o=In(e.join(" ")),c=n?.trim();return t.jsxs("div",{className:"cchoices",dir:o.dir,children:[e.map(u=>{const d=In(u),p=c?c===u.trim()?"on":"off":s?"":"off";return t.jsx("button",{className:`cch ${p} ${Is(d)}`,lang:d.dir==="rtl"?"ar":"en",dir:d.dir,disabled:!s,onClick:()=>r(u),children:u},u)}),s&&t.jsx("button",{className:"cch other",onClick:a,dir:o.dir,children:o.dir==="rtl"?"إجابة أخرى…":"Something else…"})]})}function vP(e){let n=0,s=0;for(const r of e.content){if(r.type!=="diff")continue;const a=(r.oldText??"").split(`
620
- `).filter(Boolean).length,o=r.newText.split(`
621
- `).filter(Boolean).length;n+=Math.max(0,o-(r.oldText==null?0:Math.min(a,o))),s+=r.oldText==null?0:Math.max(0,a-o)}return{title:e.title,...n||s?{plus:n,minus:s}:{}}}function Pj({s:e}){const n=vP(e);return t.jsxs("div",{className:`cstep ${e.skipped?"skipped":e.status}`,children:[e.skipped?t.jsx(Eo,{size:13}):e.status==="completed"?t.jsx(xe,{size:13,strokeWidth:2.5}):e.status==="failed"?t.jsx(Xe,{size:13}):t.jsx(jn,{size:13,className:"spin"}),t.jsx("span",{className:"cstep-t",children:n.title}),n.plus!==void 0&&t.jsxs("span",{className:"cstep-n",children:[t.jsxs("span",{className:"add",children:["+",n.plus]})," ",t.jsxs("span",{className:"del",children:["−",n.minus]})]})]})}function jP({steps:e}){const[n,s]=$.useState(!1);return t.jsxs(t.Fragment,{children:[t.jsxs("button",{className:"cactv",onClick:()=>s(!n),"aria-expanded":n,children:[t.jsx(lu,{size:13,style:{transform:n?"rotate(90deg)":void 0}})," Looked at ",e.length," ",e.length===1?"thing":"things"]}),n&&t.jsx("div",{className:"cactlist",children:e.map(r=>t.jsx(Pj,{s:r},r.id))})]})}function bP({role:e,steps:n,hasMessage:s}){const r=n.filter(c=>c.status==="in_progress").at(-1)??n.at(-1),a=r?r.title:s?"Reading your message":"Reading the ticket",o=n.slice(-6);return t.jsxs("div",{className:`cag cmsg ag-${e} thinking`,children:[t.jsx(An,{role:e,live:!0}),t.jsxs("div",{className:"cwho",children:[t.jsx("b",{children:at[e]}),t.jsx("span",{className:"shim",children:a})]}),t.jsxs("div",{className:"cagb",children:[t.jsxs("span",{className:"cdots","aria-label":`The ${at[e]} is answering`,children:[t.jsx("i",{}),t.jsx("i",{}),t.jsx("i",{})]}),o.length>0&&t.jsxs("div",{className:"csteps",children:[n.length>o.length&&t.jsxs("div",{className:"cstep more",children:["and ",n.length-o.length," earlier steps"]}),o.map(c=>t.jsx(Pj,{s:c},c.id))]})]})]})}function wP({t:e,m:n,last:s,onAsk:r}){const a=pe(),o=n.note==="failed"||!n.note&&n.text.startsWith("Could not answer"),c=e.chat?at[e.chat.with]:"agent",u=s&&e.chat?.open&&!e.chat.thinking&&(o||n.note==="stopped"),d=()=>a.mutate({path:`/api/v1/tickets/${e.id}/chat/retry`});return o?t.jsxs("div",{className:"cfail cmsg",children:[t.jsxs("div",{className:"cfail-t",children:[t.jsx(zr,{size:15})," The ",c," could not answer. Nothing was lost.",t.jsx("span",{className:"cfail-why",children:n.text.replace(/^Could not answer:\s*/,"")})]}),u&&t.jsxs("div",{className:"cbtns",children:[t.jsx("button",{className:"btn pri sm",disabled:a.isPending,onClick:d,children:"Try again"}),t.jsx("button",{className:"btn sm",onClick:r,children:"Ask something else"})]})]}):t.jsxs("div",{className:"cnote-w cmsg",children:[t.jsx("div",{className:"cnote-pill",children:n.text}),u&&t.jsx("div",{className:"cbtns",children:t.jsx("button",{className:"btn sm",disabled:a.isPending,onClick:d,children:"Ask again"})})]})}const My=10*1024*1024;function NP({t:e,size:n,text:s,setText:r,input:a,onSent:o,sendRef:c,setPending:u}){const d=pe(),{toast:p}=qe(),f=e.chat,m=at[f.with],[y,x]=$.useState([]),[k,v]=$.useState(!1),b=$.useRef(null),N=In(s),C=b7(N),S=Math.min(6,Math.max(1,s.split(`
622
- `).length)),P=async R=>{const B=[...R],I=B.find(_=>_.size>My);I&&p(`${I.name} is larger than 10 MB.`,"err");const O=await Promise.all(B.filter(_=>_.size<=My).slice(0,10).map(yo)).catch(_=>(p(_.message,"err"),[]));x(_=>[..._,...O].slice(0,10))},M=(R=s,B=[])=>{const I=[...y,...B];if(!R.trim()&&!I.length||f.thinking||d.isPending)return;u({text:R,files:I,count:f.messages.length});const O=s;r(""),x([]),o(),d.mutate({path:`/api/v1/tickets/${e.id}/chat/send`,body:{text:R,files:I.map(({name:_,data:Q})=>({name:_,data:Q}))}},{onError:()=>{u(null),r(O),x(I.filter(_=>!B.includes(_)))}})};c.current=R=>M(R);const T=()=>d.mutate({path:`/api/v1/tickets/${e.id}/chat/stop`}),F=n==="phone"?`Message the ${m}`:`Message the ${m} in Arabic or English`;return t.jsxs("div",{className:"ccomp",onDragOver:R=>(R.preventDefault(),v(!0)),onDragLeave:()=>v(!1),onDrop:R=>(R.preventDefault(),v(!1),void P(R.dataTransfer.files)),children:[k&&t.jsx("div",{className:"cdrop",children:"Drop files to add them to your message"}),t.jsx(SP,{who:m,size:n,onDone:R=>M(s,[R]),render:R=>R.on?R.box:t.jsxs("div",{className:`cbox ${n==="phone"?"m":""}`,children:[y.length>0&&t.jsx("div",{className:"cpicked",children:y.map((B,I)=>t.jsxs("span",{className:"chip",children:[B.preview?t.jsx("img",{src:B.preview,alt:""}):t.jsx(Fc,{size:12})," ",B.name,t.jsx("button",{className:"iconbtn","aria-label":`Remove ${B.name}`,onClick:()=>x(y.filter((O,_)=>_!==I)),children:t.jsx(Xe,{size:11})})]},I))}),n==="phone"&&t.jsx("button",{className:"ib","aria-label":"Add screenshots or files",onClick:()=>b.current?.click(),children:t.jsx(Tt,{size:20})}),t.jsx("textarea",{ref:a,className:`cta ${s?Is(N):"t-en"}`,dir:s?N.dir:"auto",lang:N.dir==="rtl"?"ar":"en",rows:S,value:s,placeholder:F,"aria-label":"Your message",onChange:B=>r(B.target.value),onPaste:B=>{const I=[...B.clipboardData.files];I.length&&P(I)},onKeyDown:B=>{B.key==="Enter"&&!B.shiftKey&&!B.nativeEvent.isComposing&&(B.preventDefault(),M())}}),n==="phone"?f.thinking?t.jsx("button",{className:"csend m stop",onClick:T,"aria-label":"Stop the answer",children:t.jsx(us,{size:14,fill:"currentColor"})}):s.trim()||y.length?t.jsx("button",{className:"csend m",onClick:()=>M(),"aria-label":"Send",disabled:d.isPending,children:t.jsx(os,{size:18})}):t.jsx("button",{className:"csend m mic",onClick:R.start,"aria-label":"Record a voice note",children:t.jsx(px,{size:18})}):t.jsxs("div",{className:"crow",children:[t.jsx("button",{className:"ib","aria-label":"Add screenshots or files",title:"Add screenshots or files",onClick:()=>b.current?.click(),children:t.jsx(Fc,{size:16})}),t.jsx("button",{className:"ib","aria-label":"Record a voice note",title:"Record a voice note",onClick:R.start,children:t.jsx(px,{size:16})}),C&&t.jsx("span",{className:"clchip",children:C}),t.jsx("span",{className:"grow"}),f.thinking?t.jsxs("button",{className:"cstop",onClick:T,disabled:f.stopping||d.isPending,children:[t.jsx(us,{size:11,fill:"currentColor"})," ",f.stopping?"Stopping…":"Stop"]}):t.jsx("button",{className:"csend",onClick:()=>M(),disabled:d.isPending||!s.trim()&&!y.length,"aria-label":"Send",children:t.jsx(os,{size:17})})]}),t.jsx("input",{ref:b,type:"file",multiple:!0,hidden:!0,onChange:B=>B.target.files&&void P(B.target.files)})]})}),n!=="phone"&&t.jsx("div",{className:"chint",children:"Enter sends · Shift+Enter for a new line · It answers in the language you write"})]})}function SP({who:e,size:n,onDone:s,render:r}){const{toast:a}=qe(),[o,c]=$.useState(!1),[u,d]=$.useState(0),p=$.useRef(null),f=$.useRef(!1);$.useEffect(()=>{if(!o)return;const k=setInterval(()=>d(v=>v+1),1e3);return()=>clearInterval(k)},[o]),$.useEffect(()=>()=>p.current?.stream.getTracks().forEach(k=>k.stop()),[]);const m=async()=>{try{const k=await navigator.mediaDevices.getUserMedia({audio:!0}),v=["audio/webm","audio/ogg","audio/mp4"].find(C=>MediaRecorder.isTypeSupported?.(C))??"",b=new MediaRecorder(k,v?{mimeType:v}:void 0),N=[];b.ondataavailable=C=>C.data.size&&N.push(C.data),b.onstop=()=>{if(k.getTracks().forEach(T=>T.stop()),!f.current||!N.length)return;const C=b.mimeType||v||"audio/webm",S=C.includes("ogg")?"ogg":C.includes("mp4")?"m4a":"weba",P=new Date().toTimeString().slice(0,8).replace(/:/g,""),M=new File(N,`voice-note-${P}.${S}`,{type:C});yo(M).then(s)},p.current=b,f.current=!1,d(0),b.start(),c(!0)}catch{a("The microphone is not available. Allow it for this page, or attach a voice note file.","err")}},y=k=>{f.current=k,p.current?.stop(),c(!1)},x=t.jsxs("div",{className:`crec ${n==="phone"?"m":""}`,role:"group","aria-label":"Recording a voice note",children:[t.jsx("span",{className:"crdot"}),t.jsxs("span",{className:"crt",children:["0:",String(u).padStart(2,"0")," · Recording for the ",e]}),t.jsx("span",{className:"clw","aria-hidden":"true",children:Array.from({length:22},(k,v)=>t.jsx("i",{style:{animationDelay:`${v%7*.11}s`}},v))}),t.jsx("button",{className:"btn sm",onClick:()=>y(!1),children:"Cancel"}),t.jsx("button",{className:"btn sm pri",onClick:()=>y(!0),children:"Send"})]});return t.jsx(t.Fragment,{children:r({on:o,start:()=>void m(),box:x})})}function Uo(e){return e.owner?.trim()||e.createdBy}function Qc(e,n){return!!e?.trim()&&e.trim().toLowerCase()===n?.trim().toLowerCase()}function Gi(){const e=Qe();return e.data?.ready?e.data.meta.user?.name:void 0}function Wn(e,n){return Qc(Uo(e),n)}function CP(e,n){return Wn(e,n)&&!e.takenOver&&e.stage!=="release"&&e.stage!=="done"}function $P({t:e,onClose:n}){const s=pe(),r=pe(),a=Qe(),o=Gi(),[c,u,d]=we(e.id,"hand-over-to",""),[p,f,m]=we(e.id,"hand-over-note",""),y=a.data?.ready?a.data.meta.engine==="live":!0,x=e.branch??`squad/${e.id.toLowerCase()}`,k=!!(e.live||e.squad||e.stopRequested),v=e.chat?.open?"A chat is open on this ticket. Finish the talk first.":k?"The squad is working on it right now. It hands over once the step is done, or you stop it.":null,b=$.useMemo(()=>{const S=new Map;for(const P of a.data?.ready?a.data.tickets:[])for(const M of[Uo(P),P.createdBy,P.specApproved?.by,P.handedOver?.from,P.handedOver?.to,...(P.notes??[]).map(T=>T.by)])M?.trim()&&!Qc(M,o)&&S.set(M.trim().toLowerCase(),M.trim());return[...S.values()].slice(0,8)},[a.data,o]),N=c.trim()||"them",C=()=>c.trim()&&s.mutate({path:`/api/v1/tickets/${e.id}/hand-over`,body:{to:c,note:p},done:`Handed ${e.id} over to ${c.trim()}. Their squad carries on from the branch.`},{onSuccess:()=>{d(),m(),n()}});return t.jsxs(Ve,{title:`Hand over ${e.id}`,onClose:n,icon:t.jsx("span",{className:"glyph",children:t.jsx(Mc,{size:15})}),footer:t.jsxs(t.Fragment,{children:[t.jsxs("button",{className:"btn pri",disabled:!c.trim()||!!v||s.isPending,onClick:C,children:[t.jsx(Mc,{size:15})," ",s.isPending?"Pushing…":"Hand over"]}),t.jsx("button",{className:"btn",onClick:n,children:"Cancel"}),t.jsx("span",{className:"grow"}),t.jsx(se,{text:`squad hand-over ${e.id} ${c.trim()?Hi(c.trim()):"Name"}${p.trim()?` --note ${Le(p.trim())}`:""}`})]}),children:[t.jsx("p",{children:"Give this ticket to a teammate. Their squad carries on where it is now."}),v&&t.jsxs("div",{className:"stuckbox",style:{marginBottom:14,display:"flex",gap:10,alignItems:"center"},children:[t.jsx("span",{style:{flex:1},children:v}),k&&!e.chat?.open&&t.jsxs("button",{className:"btn sm",disabled:e.stopRequested||r.isPending,onClick:()=>r.mutate({path:`/api/v1/tickets/${e.id}/stop`,done:"Stopping. The work so far is kept."}),children:[t.jsx(us,{size:12})," ",e.stopRequested?"Stopping…":"Stop"]})]}),t.jsxs("div",{className:"field",children:[t.jsx("label",{htmlFor:"handover-to",children:"Hand it over to"}),t.jsx("input",{id:"handover-to",className:"input",autoFocus:!0,value:c,placeholder:"Their name, as their board shows it",onChange:S=>u(S.target.value),onKeyDown:S=>S.key==="Enter"&&!v&&C()}),b.length>0&&t.jsx("div",{className:"pills",style:{marginTop:8},children:b.map(S=>t.jsxs("button",{className:`pill click ${Qc(S,c)?"on":""}`,onClick:()=>u(S),children:[t.jsx(wk,{size:12})," ",S]},S))})]}),t.jsxs("div",{className:"field",children:[t.jsxs("label",{htmlFor:"handover-note",children:["A note for ",N," (optional)"]}),t.jsx("textarea",{id:"handover-note",className:"input",rows:2,value:p,placeholder:"Where you got to, and anything to watch out for. Every agent reads it too.",onChange:S=>f(S.target.value)})]}),t.jsx("div",{className:"lbl",children:"What happens"}),t.jsxs("ul",{className:"brief",children:[y?t.jsxs(t.Fragment,{children:[t.jsxs("li",{children:["squad-kit saves the work so far and the ticket's documents on its branch, ",t.jsx("span",{className:"mono",children:x}),", and pushes it."]}),t.jsxs("li",{children:[N==="them"?"They become":`${N} becomes`," the owner. Their squad makes its copy of the code from that branch, and the Builder starts a fresh chat from the spec, the design and the code."]})]}):t.jsxs("li",{children:[N==="them"?"They become":`${N} becomes`," the owner. This is a sample board, so nothing is pushed."]}),t.jsx("li",{children:"Your squad stops working on it. You still see it on your board, with its new owner."})]}),t.jsx("div",{className:"lbl",children:"What stays on this computer"}),t.jsx("p",{className:"note",style:{fontSize:13},children:"Live progress, agent chats and screenshots. They see the documents and the code, not the chat. The Tester takes the screenshots again on their computer."})]})}function EP({t:e}){const n=Gi(),s=e.handedOver;return!s||!Qc(s.to,n)||!Wn(e,n)?null:t.jsxs("div",{className:"calm",style:{flex:"none",margin:"16px 28px 0"},children:[t.jsx("span",{className:"ring",children:t.jsx(Mc,{size:16})}),t.jsxs("div",{children:[t.jsxs("b",{children:[s.from," handed this ticket to you ",nn(s.at)]}),t.jsxs("span",{children:["The spec, the design, the notes and the code came with its branch. Live progress, agent chats and screenshots stayed on ",s.from,"'s computer, so the Builder starts a fresh chat from the spec, the design and the code, and the Tester takes the screenshots again."]})]})]})}function TP({t:e}){const n=Uo(e),s=e.handedOver,r=pe(),[a,o]=$.useState(!1),[c,u,d]=we(e.id,"take-back","");return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"db",children:[t.jsxs("div",{className:"calm",children:[t.jsx("span",{className:"ring",children:t.jsx(wk,{size:17})}),t.jsxs("div",{children:[t.jsxs("b",{children:[n," owns this ticket"]}),t.jsxs("span",{children:[s?`${s.from} handed it to ${s.to} ${nn(s.at)}. `:"","Their squad works on it, on their computer. You see their work here when they push it: when they hand it over, or when its pull request opens."]})]})]}),t.jsxs("p",{className:"note",style:{marginTop:12,fontSize:13},children:["Live progress and agent chats stay on ",n,"'s computer. The spec, the design and the notes here are as ",n," last pushed them."]})]}),a?t.jsxs("div",{className:"df",children:[t.jsx("input",{className:"input",style:{flex:1},autoFocus:!0,value:c,onChange:p=>u(p.target.value),placeholder:`Why you take it from ${n}, for example: the name was misspelled`}),t.jsx("button",{className:"btn pri",disabled:!c.trim()||r.isPending,onClick:()=>r.mutate({path:`/api/v1/tickets/${e.id}/take-back`,body:{reason:c},done:`${e.id} is yours now. The reason stays on the ticket.`},{onSuccess:d}),children:"Take it"}),t.jsx("button",{className:"btn",onClick:()=>o(!1),children:"Cancel"}),t.jsx(se,{text:`squad take-back ${e.id} --reason ${Le(c.trim()||"…")}`})]}):t.jsxs("div",{className:"df",children:[e.stage!=="done"&&t.jsxs("button",{className:"btn quiet",title:`When ${n} cannot work on it: the name was misspelled, or they left. If ${n} is working on it, talk to them first.`,onClick:()=>o(!0),children:[n," cannot work on it? Take it"]}),t.jsx("span",{className:"grow"}),t.jsx(se,{text:`squad show ${e.id}`})]})]})}function Rj(e=3e3){return Pe({queryKey:["requirements"],queryFn:()=>Ee("/api/v1/requirements"),refetchInterval:e})}function AP(e){return e?Kr(e.state.job)||!!e.state.build?.on||e.state.sync?.status==="running"||e.state.sync?.status==="pending"||e.counts.building>0||e.questions.some(n=>n.thinking):!1}function PP(e){return Pe({queryKey:["requirement",e],queryFn:()=>Ee(`/api/v1/requirements/${encodeURIComponent(e)}`),refetchInterval:n=>n.state.status==="error"?1e4:AP(n.state.data)?1e3:4e3,retry:!1})}function RP(e,n){return Pe({queryKey:["requirement-send",e],queryFn:()=>Ee(`/api/v1/requirements/${encodeURIComponent(e)}/send`),enabled:n,retry:!1,staleTime:0})}function Ij(e){if(!e||typeof e!="object")return null;const n=e;return Array.isArray(n.epics)&&typeof n.id=="string"?n:n.breakdown?Ij(n.breakdown):null}function wt(){const e=zn(),{toast:n}=qe(),s=$2({mutationFn:({path:r,body:a,method:o="POST"})=>bt(r,o,a??{}),onSuccess:(r,a)=>{const o=Ij(r);o&&e.setQueryData(["requirement",o.id],o),e.invalidateQueries({queryKey:["requirements"]}),e.invalidateQueries({queryKey:["board"]}),a.done&&n(a.done)},onError:(r,a)=>{a.quiet||n(zj(r),"err",nk(r)?()=>s.mutate(a):void 0)}});return s}function zj(e){return e instanceof ou&&e.status===404&&/^404\b/.test(e.message)?"This squad-kit cannot do that yet. Update squad-kit, then try again.":e instanceof Error?e.message:String(e)}function Gc(e,n){const s=Bi()??"";return`${Co(`/api/v1/requirements/${encodeURIComponent(e)}/file`)}?path=${encodeURIComponent(n)}&t=${encodeURIComponent(s)}`}const Mj=e=>`squad.send-plan.${gt??""}.${e}`;function Fy(e,n){try{sessionStorage.setItem(Mj(e),JSON.stringify(n))}catch{}}function Fj(e){try{const n=sessionStorage.getItem(Mj(e)),s=n?JSON.parse(n):null;return s&&typeof s.items=="number"&&typeof s.links=="number"?s:null}catch{return null}}const Nu=e=>`/api/v1/requirements/${encodeURIComponent(e)}`,ip=10*1024*1024,IP=10;function _i(e){const n=e instanceof Error?e.message:String(e),s=/^(\d{3}) [^:]*: ?([\s\S]*)$/.exec(n);if(!s)return zj(e);try{const r=JSON.parse(s[2]);if(r.error&&r.error!=="not found")return r.error}catch{}return s[1]==="404"?"This squad-kit cannot do that yet. Update squad-kit, then try again.":s[2]?.trim()||n}function Ly(e){const n=/\.([a-z0-9]+)$/i.exec(e)?.[1]?.toLowerCase();return n==="pdf"?"pdf":n==="docx"?"docx":n==="md"||n==="markdown"?"markdown":n==="txt"||n==="text"?"text":null}const zP={pdf:"PDF",docx:"DOCX",markdown:"MD",text:"TXT"},MP={pdf:"PDF",docx:"Word document",markdown:"Markdown",text:"Text"};function FP(e){return e<1024?`${e} bytes`:e<1024*1024?`${Math.round(e/1024)} KB`:`${(e/1024/1024).toFixed(1)} MB`}const _y=e=>e.replace(/\.[^.]+$/,"");function LP({onClose:e}){const n=wt(),s=rn(),[r,a]=$.useState(null),[o,c,u]=we("add-brd","paste",!1),[d,p,f]=we("add-brd","text",""),[m,y,x]=we("add-brd","name",""),[k,v]=$.useState(!1),[b,N]=$.useState([]),[C,S]=$.useState(!1),[P,M]=$.useState(null),T=$.useRef(null),F=async Q=>{const q=Q?[...Q][0]:void 0;if(q){if(M(null),!Ly(q.name))return M(`${q.name}: squad-kit reads PDF, Word (.docx), Markdown and text files. Save the BRD as one of those, or paste the text.`);if(q.size>ip)return M(`${q.name} is larger than 10 MB.`);try{const K=await yo(q);a(K),c(!1),k||y(_y(q.name))}catch(K){M(K.message)}}},R=async Q=>{const q=[...Q??[]],K=q.find(H=>H.size>ip);K&&M(`${K.name} is larger than 10 MB.`);const ce=await Promise.all(q.filter(H=>H.size<=ip).map(yo)).catch(H=>(M(H.message),[]));N(H=>[...H,...ce].slice(0,IP-1))},B=r?Ly(r.name):null,I=o?!!d.trim():!!r,O=o?`squad requirements add --paste${m.trim()?` --name ${Le(m.trim())}`:""}`:`squad requirements add ${r?Le(r.name):"<file>"}${r&&m.trim()&&m.trim()!==_y(r.name)?` --name ${Le(m.trim())}`:""}${b.map(Q=>` --with ${Le(Q.name)}`).join("")}`,_=()=>{if(!I)return;M(null);const Q=o?{text:d,...m.trim()?{name:m.trim()}:{},with:b.map(({name:q,data:K})=>({name:q,data:K}))}:{file:{name:r.name,data:r.data},...m.trim()?{name:m.trim()}:{},with:b.map(({name:q,data:K})=>({name:q,data:K}))};n.mutate({path:"/api/v1/requirements",body:Q},{onSuccess:q=>{u(),f(),x(),e(),s({to:"/requirements/$id",params:{id:q.id}})},onError:q=>M(_i(q))})};return t.jsxs(Ve,{title:"Add a BRD",onClose:e,losing:r||b.length?r?`the file ${r.name}`:"the attached files":null,footer:t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"rq-fcmd",children:t.jsx(se,{text:O})}),t.jsx("button",{className:"btn",onClick:e,children:"Cancel"}),t.jsxs("button",{className:"btn pri",disabled:!I||n.isPending,onClick:_,children:[n.isPending&&t.jsx(jn,{size:14,className:"spin"})," Break it down"]})]}),children:[t.jsx("p",{children:"The Analyst breaks it into epics, features and stories. Nothing is built or sent anywhere until you approve."}),t.jsxs("div",{className:"rq-add",children:[o?t.jsxs("div",{className:"field",children:[t.jsx("label",{htmlFor:"rq-paste",children:"The BRD's text"}),t.jsx("textarea",{id:"rq-paste",className:"textarea rq-pastebox",autoFocus:!0,value:d,onChange:Q=>p(Q.target.value),placeholder:"Paste the whole document here. Headings help the Analyst find its parts."}),t.jsxs("div",{className:"rq-hint",children:["Have the file?"," ",t.jsx("button",{className:"rq-link",onClick:()=>c(!1),children:"Choose a file instead"})]})]}):t.jsxs(t.Fragment,{children:[t.jsxs("label",{className:`rq-drop ${C?"over":""}`,onDragOver:Q=>{Q.preventDefault(),S(!0)},onDragLeave:()=>S(!1),onDrop:Q=>{Q.preventDefault(),S(!1),F(Q.dataTransfer.files)},children:[t.jsx("input",{type:"file",className:"sr-only",accept:".pdf,.docx,.md,.markdown,.txt",onChange:Q=>void F(Q.target.files)}),t.jsx(t8,{size:24,"aria-hidden":"true"}),t.jsxs("b",{children:["Drop your BRD here, or ",t.jsx("u",{children:"choose a file"})]}),t.jsx("span",{children:"PDF, Word, Markdown or text, up to 10 MB"})]}),r&&B&&t.jsxs("div",{className:"rq-file",children:[t.jsx("span",{className:`rq-ftag ${B}`,children:zP[B]}),t.jsxs("div",{className:"grow",children:[t.jsx("b",{children:r.name}),t.jsxs("span",{children:[FP(r.size),", ",MP[B]]})]}),t.jsx("button",{className:"iconbtn","aria-label":"Remove the file",onClick:()=>a(null),children:t.jsx(Xe,{size:14})})]}),t.jsxs("div",{className:"rq-hint",children:["No file?"," ",t.jsx("button",{className:"rq-link",onClick:()=>c(!0),children:"Paste the text instead"})]})]}),t.jsxs("div",{className:"field",children:[t.jsx("label",{htmlFor:"rq-name",children:"Name"}),t.jsx("input",{id:"rq-name",className:"input",value:m,placeholder:o?"Named after its first heading":"Named after the file",onChange:Q=>{y(Q.target.value),v(!0)}})]}),t.jsxs("div",{className:"rq-hint",children:["Screen mockups or other files that go with it?"," ",t.jsx("button",{className:"rq-link",onClick:()=>T.current?.click(),children:"Add them"}),t.jsx("input",{ref:T,type:"file",multiple:!0,className:"sr-only",tabIndex:-1,"aria-hidden":"true",onChange:Q=>void R(Q.target.files)})]}),b.length>0&&t.jsx("div",{className:"rq-extras",children:b.map((Q,q)=>t.jsxs("span",{className:"rq-extra",children:[t.jsx(_6,{size:13,"aria-hidden":"true"}),Q.name,t.jsx("button",{"aria-label":`Remove ${Q.name}`,onClick:()=>N(K=>K.filter((ce,H)=>H!==q)),children:t.jsx(Xe,{size:12})})]},`${Q.name}-${q}`))}),P&&t.jsx("p",{className:"rq-err",role:"alert",children:P}),t.jsxs("div",{className:"rq-next",children:[t.jsx("div",{className:"rq-next-h",children:"What happens next"}),t.jsxs("div",{className:"rq-nstep",children:[t.jsx("span",{children:"1"}),"The Analyst reads it and asks you only about parts that are missing or that clash."]}),t.jsxs("div",{className:"rq-nstep",children:[t.jsx("span",{children:"2"}),"You edit the breakdown and approve it."]}),t.jsxs("div",{className:"rq-nstep",children:[t.jsx("span",{children:"3"}),"Send it to Azure DevOps, let the squad build it story by story, or both."]})]})]})]})}function _P({v:e,onClose:n}){const s=wt(),r=RP(e.id,!0),[a,o]=$.useState(!1),[c,u]=$.useState(null),[d,p]=$.useState(null),f=e.tracker?.label??"the tracker",m=e.state.sync,y=a&&!c&&(s.isPending||!m||m.status==="running"||m.status==="pending"),x=a&&m?.status==="done"&&!s.isPending,k=a&&m?.status==="failed"||!!c,v=r.data,b=d7(e),N=s.isPending?Fp(void 0):Fp(m,d??Fj(e.id)),C=Gk(N),S=async()=>{u(null),o(!0);const T=k?(await r.refetch()).data??v:v,F=T?{items:T.items,links:T.first?T.counts.links:T.links}:null;p(F),F&&Fy(e.id,F),s.mutate({path:`${Nu(e.id)}/send`,quiet:!0},{onSuccess:R=>F&&R?.state?.sync?.at&&Fy(e.id,{...F,at:R.state.sync.at}),onError:R=>u(_i(R))})},P=v?.tracker.project??e.tracker?.project,M=v&&v.items===0&&v.links===0;return t.jsxs(Ve,{title:`Send to ${f}`,onClose:n,footer:t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"rq-fcmd",children:t.jsx(se,{text:`squad requirements send ${e.id}`})}),y||x?t.jsx("button",{className:"btn",onClick:n,children:"Close"}):t.jsxs(t.Fragment,{children:[t.jsx("button",{className:"btn",onClick:n,children:"Cancel"}),k?t.jsxs("button",{className:"btn pri",onClick:()=>void S(),disabled:s.isPending,children:[t.jsx(qr,{size:14})," Send again"]}):t.jsx("button",{className:"btn pri",onClick:()=>void S(),disabled:!v||!!M||s.isPending,children:v?v.first?`Send ${v.items} items`:"Send changes":"Send"})]})]}),children:[t.jsxs("p",{children:["Into ",P?t.jsxs(t.Fragment,{children:["project ",t.jsx("b",{className:"rq-ink",children:P})]}):`your ${f} project`,", as the work item types it uses. They go into the backlog, not a sprint."]}),r.isLoading?t.jsx("p",{className:"note",children:"Working out what to send…"}):r.isError?t.jsxs("div",{className:"rq-err",role:"alert",children:["squad-kit could not work out what to send. ",_i(r.error)," ",t.jsx("button",{className:"rq-link",onClick:()=>void r.refetch(),children:"Try again"})]}):v?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"rq-send",children:[t.jsxs("div",{className:"rq-li",children:[t.jsx("b",{children:v.counts.epics.all}),Mh(v.levels.epic),t.jsx("span",{children:Fh(v.counts.epics,v.first)})]}),v.counts.features.all>0&&t.jsxs("div",{className:"rq-li",children:[t.jsx("b",{children:v.counts.features.all}),Mh(v.levels.feature),", each under its epic",t.jsx("span",{children:Fh(v.counts.features,v.first)})]}),t.jsxs("div",{className:"rq-li",children:[t.jsx("b",{children:v.counts.stories.all}),Mh(v.levels.story),", each under its ",v.counts.storiesUnderEpic?v.counts.features.all?"feature or epic":"epic":"feature",t.jsx("span",{children:v.first?'with "done when" as acceptance criteria':Fh(v.counts.stories,!1)})]}),(v.first?v.counts.links:v.links)>0&&t.jsxs("div",{className:"rq-li",children:[t.jsx("b",{children:v.first?v.counts.links:v.links}),v.first?"Links between stories that need each other":"New links between stories that need each other",b&&t.jsxs("span",{children:['"',b,'"']})]})]}),M&&t.jsx("p",{className:"note",children:"Everything is sent already. Edit the breakdown and Send changes updates the same items."})]}):null,t.jsxs("div",{className:"rq-promise",children:[t.jsx("div",{children:"Each story's number, like AB#120, shows in the breakdown. When the squad builds a story, its item moves forward and gets the squad's notes, as tickets from the Backlog do today."}),t.jsxs("div",{children:["Edit the breakdown later and ",t.jsx("b",{children:"Send changes"})," updates the same items. squad-kit never deletes anything in ",f,"."]})]}),a&&(y||x||k)&&t.jsx("div",{className:`rq-sendprog ${k?"fail":""}`,role:"status",children:k?t.jsxs("span",{children:[t.jsx("b",{children:"The send stopped."})," ",c??m?.error??"Something went wrong on the way."," What was sent stays sent; Send again carries on without doubles."]}):x?t.jsxs("span",{children:[t.jsx("b",{children:"Sent."})," Each item's number shows in the breakdown now."]}):t.jsxs(t.Fragment,{children:[t.jsxs("span",{children:[N.phase==="links"?`${C.charAt(0).toUpperCase()}${C.slice(1)}`:`Sending${C?` ${C}`:""}`,"… You can close this: it carries on."]}),t.jsx("span",{className:"rq-pbar",role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":N.pct,"aria-label":"Sent so far",children:t.jsx("i",{style:{width:`${N.pct||5}%`}})})]})})]})}function OP({v:e,item:n,text:s,onClose:r}){const a=wt(),[o,c]=$.useState(s??""),u=n===e.id,d=u?null:Vn(e,n),p=e.status==="approved"&&Fo(e).some(({story:m})=>m.ticket),f=()=>a.mutate({path:`${Nu(e.id)}/items/${encodeURIComponent(n)}/redo`,body:{ask:o.trim()},done:`The Analyst is redoing ${u?"the breakdown":n}.`},{onSuccess:r});return t.jsxs(Ve,{title:u?"Ask the Analyst":`Ask the Analyst to redo ${n}`,onClose:r,footer:t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"rq-fcmd",children:t.jsx(se,{text:`squad requirements redo ${e.id} ${n} ${Le(o.trim()||"what to change")}`})}),t.jsx("button",{className:"btn",onClick:r,children:"Cancel"}),t.jsx("button",{className:"btn pri",disabled:!o.trim()||a.isPending,onClick:f,children:"Ask the Analyst"})]}),children:[t.jsxs("p",{children:[u?"Say what to change in the breakdown, or what to add. The Analyst rewrites it and keeps the keys of what stays.":`Say what to change in ${n} ${d?.item.title??""}. The Analyst rewrites it and keeps its key.`,p&&" Stories that started stay as they are."]}),t.jsxs("div",{className:"field",children:[t.jsx("label",{htmlFor:"rq-ask",children:"What should change"}),t.jsx("textarea",{id:"rq-ask",className:"textarea",autoFocus:!0,value:o,onChange:m=>c(m.target.value),placeholder:u?"Add a story for staff to export bookings, under Admin and reports.":"Split it in two: one for holding the slot, one for freeing it."})]})]})}function qP({v:e,level:n,under:s,onClose:r,onAdded:a}){const o=wt(),c=$.useMemo(()=>n==="feature"?e.epics.map(N=>({key:N.key,label:`${N.key} ${N.title}`})):n==="story"?e.epics.flatMap(N=>[...N.features.map(C=>({key:C.key,label:`${N.title} › ${C.title}`})),{key:N.key,label:`${N.title}, straight under the epic`}]):[],[e.epics,n]),[u,d]=$.useState(s&&c.some(N=>N.key===s)?s:c.at(n==="story"?0:-1)?.key??""),[p,f,m]=we(e.id,`add-${n}-title`,""),[y,x,k]=we(e.id,`add-${n}-about`,""),v=n==="epic"?"an epic":`a ${n}`,b=()=>o.mutate({path:`${Nu(e.id)}/items`,body:{title:p.trim(),...n!=="epic"?{under:u,level:n}:{},...y.trim()?n==="epic"?{goal:y.trim()}:n==="feature"?{summary:y.trim()}:{story:y.trim()}:{}}},{onSuccess:N=>{m(),k(),a(N.key),r()}});return t.jsxs(Ve,{title:`Add ${v}`,onClose:r,footer:t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"rq-fcmd",children:t.jsx(se,{text:`squad requirements add-item ${e.id}${n!=="epic"?` --under ${u}`:""}${n==="feature"?" --feature":""} --title ${Le(p.trim()||"…")}`})}),t.jsx("button",{className:"btn",onClick:r,children:"Cancel"}),t.jsxs("button",{className:"btn pri",disabled:!p.trim()||n!=="epic"&&!u||o.isPending,onClick:b,children:["Add ",v]})]}),children:[n!=="epic"&&t.jsxs("div",{className:"field",children:[t.jsx("label",{htmlFor:"rq-under",children:"Under"}),t.jsx("select",{id:"rq-under",className:"select",value:u,onChange:N=>d(N.target.value),children:c.map(N=>t.jsx("option",{value:N.key,children:N.label},N.key))})]}),t.jsxs("div",{className:"field",children:[t.jsx("label",{htmlFor:"rq-title",children:"Title"}),t.jsx("input",{id:"rq-title",className:"input",autoFocus:!0,value:p,onChange:N=>f(N.target.value),onKeyDown:N=>N.key==="Enter"&&p.trim()&&b()})]}),t.jsxs("div",{className:"field",children:[t.jsx("label",{htmlFor:"rq-about",children:n==="epic"?"What it is for":n==="feature"?"What it covers":"Story"}),t.jsx("textarea",{id:"rq-about",className:"textarea",value:y,onChange:N=>x(N.target.value),placeholder:n==="story"?"As a …, I want …, so that …":"One or two sentences"})]}),n==="story"&&t.jsx("p",{className:"note",children:'Add its "done when" checks on its panel before you approve.'})]})}function DP({v:e,onClose:n,onOpenRef:s,onAsk:r}){return t.jsxs(Ve,{title:`${e.leftOut.length} ${e.leftOut.length===1?"part":"parts"} left out`,onClose:n,children:[t.jsx("p",{children:"Parts of the BRD the breakdown leaves out on purpose, and why. Ask the Analyst to add one if it should be built."}),t.jsx("div",{className:"rq-leftout",children:e.leftOut.map((a,o)=>t.jsxs("div",{className:"rq-lo",children:[t.jsx("b",{children:a.text}),t.jsx("span",{children:a.why}),t.jsxs("div",{className:"rq-lo-acts",children:[a.ref&&t.jsx("button",{className:"rq-link",onClick:()=>s(a.ref),children:Mo(a.ref)}),r&&t.jsxs("button",{className:"btn sm",onClick:()=>r($x(a)),title:`squad requirements redo ${e.id} ${e.id} ${Le($x(a))}`,children:[t.jsx(Pn,{size:13})," Ask the Analyst to add it"]})]})]},o))})]})}function Oy({items:e,ok:n}){return t.jsx("ul",{className:"rmlist",children:e.map(s=>t.jsxs("li",{children:[n?t.jsx(xe,{size:16,className:"ok","aria-hidden":!0}):t.jsx(Xe,{size:16,className:"x","aria-hidden":!0}),t.jsx("span",{children:s})]},s))})}function Lj({id:e,title:n,sentTo:s,onClose:r,onDeleted:a}){const o=wt(),[c,u]=$.useState(null),d=()=>o.mutate({path:Nu(e),method:"DELETE",quiet:!0,done:`Deleted ${e}.`},{onSuccess:()=>{r(),a?.()},onError:p=>u(_i(p))});return au.createPortal(t.jsxs(Ve,{title:`Delete ${e}?`,icon:t.jsx("span",{className:"glyph",children:t.jsx(vn,{size:15})}),onClose:r,footer:t.jsxs(t.Fragment,{children:[t.jsxs("button",{className:"btn danger",disabled:o.isPending,onClick:d,children:[t.jsx(vn,{size:15})," ",o.isPending?"Deleting…":`Delete ${e}`]}),t.jsx("button",{className:"btn",onClick:r,children:c?"Keep it":"Cancel"}),t.jsx("span",{className:"grow"}),t.jsx(se,{text:`squad requirements delete ${e}`})]}),children:[t.jsx("p",{children:n}),c&&t.jsx("div",{className:"stuckbox rm-gap",role:"alert",children:c}),t.jsx("div",{className:"lbl",children:"This removes"}),t.jsx(Oy,{items:["The breakdown: its epics, features and stories, and what was decided for you",`The document, its text and its pictures (.squad/requirements/${e})`,"What this computer kept about it: the Analyst's progress and the build switch"]}),t.jsx("div",{className:"lbl",children:"This stays"}),t.jsx(Oy,{ok:!0,items:["Tickets that started from its stories, with their code and history",...s?[`Its items in ${s}: squad-kit never deletes there`]:[]]}),t.jsx("p",{className:"rm-note",children:"It cannot be deleted while its stories build. Wait until they merge, or delete those tickets first."})]}),document.body)}function _j({choices:e,label:n="More actions"}){const[s,r]=$.useState(!1),a=$.useRef(null);return $.useEffect(()=>{if(!s)return;const o=u=>a.current&&!a.current.contains(u.target)&&r(!1),c=u=>{u.key==="Escape"&&(u.preventDefault(),r(!1))};return document.addEventListener("mousedown",o),document.addEventListener("keydown",c),()=>{document.removeEventListener("mousedown",o),document.removeEventListener("keydown",c)}},[s]),e.length?t.jsxs("span",{className:"more rq-more",ref:a,children:[t.jsx("button",{className:"iconbtn","aria-label":n,"aria-haspopup":"menu","aria-expanded":s,title:n,onClick:()=>r(!s),children:t.jsx(hk,{size:16})}),s&&t.jsx("div",{className:"more-menu",role:"menu",children:e.map(o=>t.jsx("button",{role:"menuitem",className:o.danger?"danger":"",title:o.title,onClick:()=>{r(!1),o.onPick()},children:o.label},o.key))})]}):null}function BP(e,n){return`${Gc(e.id,e.source.file)}${n?.page?`#page=${n.page}`:""}`}async function WP(e,n){const s=await fetch(Gc(e,n));if(!s.ok)throw new Error(s.status===404?"not found":`${s.status}`);return s.text()}function Oj({v:e,at:n,onClose:s}){const[r,a]=$.useState(null),[o,c]=$.useState(null),u=$.useRef(null),d=Math.max(1,e.source.kind==="pdf"?0:e.source.pages??1);$.useEffect(()=>{let f=!0;const m=Array.from({length:d},(y,x)=>`text/part-${String(x+1).padStart(2,"0")}.md`);return Promise.all(m.map(y=>WP(e.id,y).catch(()=>""))).then(y=>{f&&(y.some(Boolean)||c("squad-kit could not open the text of this document. Download the original instead."),a(y))}).catch(()=>f&&c("squad-kit could not open the text of this document.")),()=>{f=!1}},[e.id,d]),$.useEffect(()=>{if(!r||!n||!u.current)return;const f=[...u.current.querySelectorAll("h1, h2, h3, h4, h5, h6")],m=x=>{const k=(x.textContent??"").trim().toLowerCase();return n.section&&(k===n.section.toLowerCase()||k.startsWith(`${n.section.toLowerCase()} `))||n.title&&k.includes(n.title.toLowerCase())},y=f.find(m);y&&(y.classList.add("rq-hit"),y.scrollIntoView({block:"start"}))},[r,n]);const p=f=>/^(https?:|data:)/.test(f)?f:Gc(e.id,f.replace(/^(\.\.\/)+/,""));return t.jsx(Ve,{wide:!0,title:e.source.name,onClose:s,footer:t.jsxs(t.Fragment,{children:[n&&t.jsx("span",{className:"note",children:Mo(n)}),t.jsx("span",{className:"grow"}),t.jsxs("a",{className:"btn",href:Gc(e.id,e.source.file),target:"_blank",rel:"noreferrer",download:e.source.name,children:[t.jsx(ls,{size:14})," The original"]}),t.jsx("button",{className:"btn pri",onClick:s,children:"Close"})]}),children:t.jsx("div",{className:"rq-doc",ref:u,children:o?t.jsx("p",{className:"rq-err",children:o}):r?r.map((f,m)=>t.jsx(Zf,{remarkPlugins:[nm],components:{img:({src:y,alt:x})=>t.jsx("img",{src:y?p(y):"",alt:x??"",loading:"lazy"}),a:({href:y,children:x})=>t.jsxs("a",{href:y,target:"_blank",rel:"noreferrer",children:[x," ",t.jsx(is,{size:11})]})},children:f},m)):t.jsx("p",{className:"note",children:"Opening the document…"})})})}function qj(e){const[n,s]=$.useState(void 0);return{open:r=>{e&&(e.source.kind==="pdf"?window.open(BP(e,r),"_blank","noopener"):s(r??null))},viewer:n,close:()=>s(void 0)}}function UP(e,n,s){return Fo(e).filter(({story:r})=>r.key!==n&&!s.includes(r.key)).map(({story:r})=>({key:r.key,label:`${r.key} ${r.title}`}))}const HP={gap:"Missing in the BRD",clash:"Two parts clash",check:"A check failed"};function pm(e){if(e.track!=="auto"||!e.waiting)return null;if(e.waiting.kind==="ask"&&e.agentQuestion?.kind&&!e.agentQuestion.answer)return e.agentQuestion.kind;const n=e.waiting.kind==="stuck"?e.stuck?.gate:void 0;return n==="checks"||n==="review"||n==="proof"?"check":null}function Dj(e,n){return`/requirements/${encodeURIComponent(e)}${n?`?item=${encodeURIComponent(n)}`:""}`}function VP(e,n){for(const s of e?.epics??[]){for(const r of s.features)if(r.stories.some(a=>a.key===n))return[s.title,r.title,n].join(" › ");if(s.stories.some(r=>r.key===n))return[s.title,n].join(" › ")}return n}const qy=/\s*\(suggested\)\s*$/i;function KP(e){return e.map(n=>({text:n.replace(qy,""),suggested:qy.test(n)}))}function YP(e){return e.stage==="specs"?"planning":e.stage==="implement"?"building":e.stage==="test"?"testing":e.stage==="review"?"reviewing":"working"}function QP(e){return e.length<=1?e[0]??"":`${e.slice(0,-1).join(", ")} and ${e.at(-1)}`}function GP(e,n){const s=e.epics.flatMap(c=>[...c.features.flatMap(u=>u.stories),...c.stories]),r=new Set(e.progress.filter(c=>c.state==="merged"||c.state==="released").map(c=>c.key)),a=new Set,o=c=>{for(const u of s)u.dependsOn.includes(c)&&!a.has(u.key)&&(a.add(u.key),o(u.key))};return o(n),s.filter(c=>a.has(c.key)&&!r.has(c.key)).map(c=>`${c.key} ${c.title}`)}function ZP(e,n){if(!e||!n.breakdown)return"";const s=GP(e,n.breakdown.item),r=!!e.state.build?.on;return s.length?`${QP(s)} ${s.length===1?"waits":"wait"} for your answer.${r?" The other stories keep building.":""}`:r?"No other story waits for it: the others keep building.":""}function XP(e){return e.ticket||!e.page&&!e.section?null:{...e.section?{section:e.section}:{},...e.page?{page:e.page}:{}}}function Bj(e){return Pe({queryKey:["requirements",e,"view"],queryFn:()=>Ee(`/api/v1/requirements/${e}`),enabled:!!e,refetchInterval:4e3})}function fm({id:e,item:n,children:s,className:r}){const a=sn(),o=Dj(e,n),c=u=>{u.metaKey||u.ctrlKey||u.shiftKey||u.button!==0||(u.preventDefault(),a.navigate({href:`${zi}${o}`}))};return t.jsx("a",{className:r,href:`${zi}${o}`,onClick:c,children:s})}function JP({t:e}){return e.track==="auto"?t.jsx("span",{className:"autochip",children:"Builds by itself"}):t.jsxs(t.Fragment,{children:[t.jsx("b",{children:e.track==="express"?"Express":"Full"})," track"]})}function eR({t:e}){const n=Bj(e.breakdown?.id).data;return e.breakdown?t.jsxs("div",{className:"brdplace",children:["From"," ",t.jsx(fm,{id:e.breakdown.id,item:e.breakdown.item,children:e.breakdown.id})," ","› ",VP(n,e.breakdown.item)]}):null}function tR({t:e}){return e.track!=="auto"?null:t.jsx("span",{className:"prio auto",children:"Builds by itself"})}function nR({t:e}){return e.breakdown?t.jsxs("div",{className:"bkey",title:`From ${e.breakdown.id} › ${e.breakdown.item}`,children:[e.breakdown.id," › ",e.breakdown.item]}):null}function Wj({kind:e}){return t.jsx("span",{className:`stoptag ${e}`,children:HP[e]})}function sR({t:e,extra:n}){const s=pe(),r=e.agentQuestion,a=r.kind,o=Bj(e.breakdown?.id).data,c=KP(r.options),[u,d]=$.useState(()=>c.find(v=>v.suggested)?.text??null),[p,f]=we(e.id,"stop-own",""),m=at[r.from],y=u===""?p.trim():u,x=ZP(o,e),k=qj(o);return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"db",children:[t.jsxs("section",{className:"stopcard","aria-label":"Needs you",children:[t.jsxs("div",{className:"stophead",children:[t.jsx(Wj,{kind:a}),t.jsxs("span",{children:["The ",m," found it while ",YP(e),", ",nn(r.at)]})]}),t.jsx("p",{className:"stuckq",children:r.text}),t.jsx(rR,{list:r.sources,onOpenRef:o?k.open:void 0}),r.files&&r.files.length>0&&t.jsx(mj,{ticket:e.id,files:r.files}),t.jsxs("div",{className:"opts2",children:[c.map(v=>t.jsxs("button",{className:`opt2 ${u===v.text?"pick":""}`,onClick:()=>d(v.text),"aria-pressed":u===v.text,children:[t.jsx("b",{children:v.text}),(v.suggested||u===v.text)&&t.jsxs("span",{className:"optfoot",children:[v.suggested&&t.jsxs("span",{className:"rec",children:[m," suggests"]}),u===v.text&&t.jsxs("span",{className:"yourpick",children:[t.jsx(xe,{size:13,strokeWidth:2.5})," Your pick"]})]})]},v.text)),t.jsx("button",{className:`opt2 ${u===""?"pick":""}`,onClick:()=>d(""),"aria-pressed":u==="",children:t.jsx("b",{children:"Something else…"})})]}),u===""&&t.jsx("textarea",{className:"input",rows:3,style:{width:"100%"},autoFocus:!0,value:p,placeholder:"Your answer",onChange:v=>f(v.target.value)}),(r.why||x)&&t.jsx("p",{className:"stopwhy",children:[r.why,x].filter(Boolean).join(" ")})]}),t.jsx(mm,{t:e}),n]}),o&&k.viewer!==void 0&&au.createPortal(t.jsx(Oj,{v:o,at:k.viewer??void 0,onClose:k.close}),document.body),t.jsxs("div",{className:"df",children:[t.jsxs("button",{className:"btn you",disabled:!y||s.isPending,onClick:()=>s.mutate({path:`/api/v1/tickets/${e.id}/reply`,body:{text:y},done:`Sent. The ${m} carries on.`}),children:[t.jsx(hs,{size:15})," Answer"]}),!e.chat?.open&&t.jsx(Zr,{t:e,agent:r.from,label:"Ask about this"}),t.jsx("span",{className:"grow"}),t.jsx(se,{text:`squad reply ${e.id}${y?` ${Le(y.length>40?`${y.slice(0,40)}…`:y)}`:""}`})]})]})}function rR({list:e,onOpenRef:n}){return e?.length?t.jsxs("p",{className:"stopsrc",children:["Sources:"," ",e.map((s,r)=>{const a=XP(s);return t.jsxs("span",{children:[r>0&&" · ",s.ticket?t.jsx(Te,{to:"/board",search:{ticket:s.ticket},children:s.text}):a&&n?t.jsx("button",{className:"linkbtn",onClick:()=>n(a),title:"Open this place in the document",children:s.text}):s.text]},`${s.text}-${r}`)})]}):null}function Uj(e){return e.by==="answer"?"from your answer":`${e.by.charAt(0).toUpperCase()}${e.by.slice(1)}`}function iR({d:e}){const n=e.changed?.ticket;return n?/^c\d+$/.test(n)?t.jsxs("span",{className:"became",children:["It became change ",n," on this ticket."]}):t.jsxs("span",{className:"became",children:["It became"," ",t.jsx(Te,{to:"/board",search:{ticket:n},children:n}),", linked to this one."]}):null}function mm({t:e}){const n=Gi(),[s,r]=$.useState(null),a=e.decided??[];if(!a.length)return null;const o=Wn(e,n)||!n;return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"lbl",children:"Decided for you on this story"}),t.jsx("ul",{className:"decided",children:a.map(c=>t.jsxs("li",{children:[t.jsxs("span",{className:"dwho",children:[Uj(c)," · ",nn(c.at)]}),c.changed?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"was",children:c.text}),t.jsxs("span",{children:[t.jsx("b",{children:"Now:"})," ",c.changed.text]}),t.jsx(iR,{d:c})]}):t.jsxs(t.Fragment,{children:[t.jsx("span",{children:c.text}),o&&t.jsx("button",{className:"linkbtn",onClick:()=>r(c),children:"Change"})]})]},c.id))}),s&&t.jsx(aR,{t:e,d:s,onClose:()=>r(null)})]})}function aR({t:e,d:n,onClose:s}){const r=pe(),{toast:a}=qe(),[o,c,u]=we(e.id,`decided-${n.id}`,""),d=Ps(e),p=o.trim();return t.jsxs(Ve,{title:"Change what was decided",icon:t.jsx(cs,{size:16}),onClose:s,footer:t.jsxs(t.Fragment,{children:[t.jsxs("button",{className:"btn pri",disabled:!p||r.isPending,onClick:()=>r.mutate({path:`/api/v1/tickets/${e.id}/decided/${n.id}`,body:{text:p}},{onSuccess:f=>{a(Zk(e.id,f?.decided?.find(m=>m.id===n.id)?.changed?.ticket)),u(),s()}}),children:[t.jsx(cs,{size:15})," Change it"]}),t.jsx("button",{className:"btn",onClick:s,children:"Cancel"}),t.jsx("span",{className:"grow"}),t.jsx(se,{text:`squad decided ${e.id} ${n.id} ${Le(p||"what you want instead")}`})]}),children:[t.jsx("p",{className:"note",style:{marginBottom:8},children:n.by==="answer"?"From your answer, the squad decided:":`The ${Uj(n)} decided:`}),t.jsx("div",{className:"decidedq",children:n.text}),t.jsx("label",{className:"lbl",htmlFor:"decided-instead",style:{marginTop:0},children:"What do you want instead?"}),t.jsx("textarea",{id:"decided-instead",className:"input",rows:3,style:{width:"100%"},autoFocus:!0,value:o,onChange:f=>c(f.target.value),placeholder:"For example: the refund goes back as store credit"}),t.jsx("p",{className:"note",style:{marginTop:8},children:d?`${e.id} is merged, so this becomes a new ticket linked to it.`:"It becomes a small change on this ticket: the Analyst writes it into the spec, you approve it, and the Builder makes it."})]})}function Su(){return Pe({queryKey:["requirements","waiting"],queryFn:()=>Ee("/api/v1/requirements/waiting"),enabled:!!gt,refetchInterval:3e3}).data?.breakdowns??[]}function Hj(){const n=(Pe({queryKey:["app","projects"],queryFn:()=>Ee("/api/v1/app/projects"),refetchInterval:2e3}).data?.projects??[]).filter(r=>r.open);return C4({queries:n.map(r=>({queryKey:["app","requirements-waiting",r.id],queryFn:()=>Ee(`/p/${encodeURIComponent(r.id)}/api/v1/requirements/waiting`),refetchInterval:3e3,retry:!1}))}).flatMap((r,a)=>(r.data?.breakdowns??[]).map(o=>({...o,project:{id:n[a].id,name:n[a].name}})))}function Vj(e){return`/p/${encodeURIComponent(e.project.id)}${Dj(e.id)}`}function oR(e){return`squad requirements answer ${e.id}${e.project?` --project ${Hi(e.project.name)}`:""}`}function tf(e){return`The Analyst has ${e.questions} ${e.questions===1?"question":"questions"}`}function lR({w:e}){return t.jsxs("div",{className:"yitem",title:`${e.project?`${e.project.name} · `:""}${e.id} · ${e.title}
623
- ${tf(e)}`,children:[t.jsx("span",{className:"yid",children:e.project?`${e.project.name} · ${e.id}`:e.id}),t.jsx("span",{className:"yline",children:tf(e)}),e.project?t.jsx("a",{className:"btn sm you",href:Vj(e),children:"Answer"}):t.jsx(fm,{id:e.id,className:"btn sm you",children:"Answer"})]})}function Kj({w:e}){return t.jsxs("div",{className:"wcard",style:{padding:"16px 18px 16px 22px"},children:[t.jsxs("div",{className:"grow",children:[t.jsxs("div",{className:"meta",children:[e.project&&t.jsx("span",{className:"pill sm",children:e.project.name}),t.jsx("span",{className:"id",children:e.id}),t.jsx("span",{children:"Requirements"}),t.jsx("span",{children:nn(e.since)})]}),t.jsx("h3",{children:e.title}),t.jsxs("p",{children:[tf(e),". It writes the breakdown once you answer."]})]}),t.jsx(se,{text:oR(e)}),e.project?t.jsx("a",{className:"btn pri sm",href:Vj(e),children:"Answer"}):t.jsx(fm,{id:e.id,className:"btn pri sm",children:"Answer"})]})}function Yj({t:e}){const n=pm(e);return n?t.jsx(Wj,{kind:n}):null}function Qj(){return Pe({queryKey:["app","waiting"],queryFn:()=>Ee("/api/v1/app/waiting"),refetchInterval:2e3})}function Dy(){const e=Qe(),n=Ec({select:o=>o.location.pathname}),s=e.data?.ready?e.data:null,r=$.useMemo(()=>(s?.tickets??[]).filter(zo).map(o=>({key:o.id,since:Lk(o),ticket:o})),[s]),a=Su();return Gj(s?.meta.project,r.length+a.length),eb(),n.startsWith("/inbox")?null:t.jsx(Zj,{items:r,breakdowns:a})}function cR(){const e=Qj(),n=$.useMemo(()=>(e.data?.items??[]).map(({project:r,ticket:a})=>({key:`${r.id}/${a.id}`,since:Lk(a),ticket:a,project:r})),[e.data]),s=Hj();return Gj("squad-kit",n.length+s.length),eb(),t.jsx(Zj,{items:n,breakdowns:s,home:!0})}function Gj(e,n){$.useEffect(()=>{e&&(document.title=N8(e,n))},[e,n])}function uR(e){const[n,s]=$.useState(Date.now);return $.useEffect(()=>{const r=setInterval(()=>s(Date.now()),e);return()=>clearInterval(r)},[e]),n}function Zj({items:e,home:n,breakdowns:s=[]}){const[r]=$.useState(()=>new C8),a=uR(3e4),o=$.useMemo(()=>r.sort(e),[r,e]),c=o.length+s.length;if(!c)return null;const u=o.slice(0,2),d=s.slice(0,2-u.length),p=c-u.length-d.length,f=c===1?"1 thing needs you":`${c} things need you`,m=y=>p>0&&(n?t.jsxs("button",{className:`ymore ${y}`,onClick:()=>document.getElementById("waiting")?.scrollIntoView({behavior:"smooth",block:"start"}),children:["and ",p," more"]}):t.jsxs(Te,{to:"/inbox",className:`ymore ${y}`,children:["and ",p," more"]}));return t.jsxs("section",{className:"ybar","aria-label":"Waiting for you",children:[t.jsx("span",{className:"ybar-n","aria-hidden":!0,children:c}),t.jsx("b",{className:"ybar-t","aria-live":"polite",title:n?"The squads keep working on everything else meanwhile.":"The squad keeps working on everything else meanwhile.",children:f}),t.jsxs("div",{className:"ybar-items",children:[u.map(y=>t.jsx(dR,{it:y,now:a},y.key)),d.map(y=>t.jsx(lR,{w:y},`${y.project?.id??""}/${y.id}`))]}),m("ymore-row"),t.jsx(mR,{})]})}function dR({it:e,now:n}){const s=e.ticket,r=Es(s)?Vr(s):void 0,a=s.waiting?.summary??(r?`Change ${r.id} to the spec waits for you`:ds(s)?Pf(s):s.outdated?.length?Tf(s):`Looks stuck: ${s.quiet?.detail??"no progress"}`),o=s.waiting?Oc(s):r?"Check the change":"Check it",c=s.waiting?.kind==="ask"&&s.agentQuestion?`“${s.agentQuestion.text}”`:s.title,u=[e.project?.name,s.id,As[s.stage],S8(e.since,n)].filter(Boolean).join(" · ");return t.jsxs("div",{className:"yitem",title:`${u}
624
- ${a}
625
- ${c}`,children:[t.jsx("span",{className:"yid",children:e.project?`${e.project.name} · ${s.id}`:s.id}),t.jsx("span",{className:"yline",children:pm(s)?t.jsxs(t.Fragment,{children:[t.jsx(Yj,{t:s}),s.title]}):a}),e.project?t.jsx("a",{className:"btn sm you",href:Ok(e.project.id,s),children:o}):s.waiting?.kind==="proof"?t.jsx(Te,{to:"/tickets/$id/proof",params:{id:s.id},className:"btn sm you",children:o}):t.jsx(Te,{to:"/board",search:{ticket:s.id},className:"btn sm you",children:o})]})}const Xj="sk.notices";function ko(){try{return window.localStorage}catch{return null}}function gm(){const e=ko()?.getItem(Xj);return e==="on"||e==="off"?e:null}function xm(){return typeof Notification>"u"?window.isSecureContext===!1?"insecure":"none":window.isSecureContext===!1?"insecure":Notification.permission}let ym=!1;function By(e){ym=e,Jj()}const nf=new Set,Jj=()=>nf.forEach(e=>e());function hR(e){return nf.add(e),window.addEventListener("storage",e),window.addEventListener("focus",e),document.addEventListener("visibilitychange",e),()=>{nf.delete(e),window.removeEventListener("storage",e),window.removeEventListener("focus",e),document.removeEventListener("visibilitychange",e)}}const pR=()=>`${gm()??""}|${xm()}|${ym?"asking":""}`;function ap(e){try{ko()?.setItem(Xj,e)}catch{}Jj()}function fR(){try{new Notification("Desktop notices are on",{body:"squad-kit shows one like this for each new thing that needs you.",tag:"sk-notices-on",silent:!0})}catch{}}function km(){const{toast:e}=qe(),[n,s,r]=$.useSyncExternalStore(hR,pR).split("|"),a=n||null;return{choice:a,permission:s,asking:r==="asking",on:a==="on"&&s==="granted",canAsk:a===null&&(s==="default"||s==="granted"),turnOn:async()=>{if(ym)return;By(!0);let c="error";try{c=await F8(typeof Notification>"u"?void 0:Notification,{secure:window.isSecureContext!==!1})}finally{By(!1)}const u=L8(c);u.choice&&ap(u.choice),u.test&&fR(),e(u.say,u.bad?"err":void 0)},turnOff:()=>{ap("off"),e("Desktop notices are off")},notNow:()=>{ap("off"),e("No desktop notices. Turn them on in Settings any time.")}}}function mR(){const e=km();return!e.canAsk&&!e.asking?null:t.jsxs("div",{className:"ybar-ask","aria-live":"polite",title:e.asking?qk:"Get a desktop notice when the squad needs you",children:[t.jsx(Ep,{size:14}),t.jsx("button",{className:"linkbtn",disabled:e.asking,onClick:()=>void e.turnOn(),children:e.asking?"Waiting for your browser…":"Desktop notices"}),!e.asking&&t.jsx("button",{className:"linkbtn quiet",onClick:e.notNow,"aria-label":"No desktop notices",children:"Not now"})]})}function gR(){const e=km();return t.jsxs("div",{className:"maprow",style:{alignItems:"center"},children:[t.jsx("b",{children:"Desktop notices"}),t.jsx("span",{style:{display:"flex",gap:10,alignItems:"center",flexWrap:"wrap"},children:e.permission==="none"?t.jsx("span",{className:"note",children:"This browser can't show desktop notices. The banner and the tab title still show what needs you."}):e.permission==="insecure"?t.jsx("span",{className:"note",children:"Your browser shows desktop notices only on a secure page. Open the board on this computer, at its 127.0.0.1 or localhost address, to turn them on."}):e.permission==="denied"?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"pill you",children:"Blocked by your browser"}),t.jsx("span",{className:"note",children:Ka})]}):t.jsxs(t.Fragment,{children:[t.jsx("button",{className:"btn sm",disabled:e.asking,onClick:()=>e.on?e.turnOff():void e.turnOn(),children:e.asking?"Waiting for your browser…":e.on?"On: turn them off":"Off: turn them on"}),t.jsx("span",{className:"note","aria-live":"polite",children:e.asking?qk:e.choice==="on"&&e.permission==="default"?`You turned them on, but your browser has not allowed them yet. ${Ka}`:"A notice for each new question, approval, proof and failure, in this browser. No sounds."})]})})]})}const xR=new R8;function eb(){kR();const e=Qj(),n=rn(),s=e.data;$.useEffect(()=>{if(!s)return;const r=xR.next(P8(s.items),Date.now());if(!r.length||gm()!=="on"||xm()!=="granted")return;const a=o=>{if(o.project.id!==gt)return window.location.assign(Ok(o.project.id,o.ticket));if(o.ticket.waiting?.kind==="proof")return void n({to:"/tickets/$id/proof",params:{id:o.ticket.id}});n({to:"/board",search:{ticket:o.ticket.id}})};for(const o of r)_k(o.key,Date.now(),ko())&&yR(o,a)},[s,n])}function yR(e,n){const{title:s,body:r}=z8(e);tb(s,r,e.key,()=>n(e))}function tb(e,n,s,r){try{const a=new Notification(e,{body:n,tag:s,silent:!0});a.onclick=()=>{window.focus(),a.close(),r()}}catch{}}function kR(){const e=uo(ko()).length>0,s=Pe({queryKey:["app","projects"],queryFn:()=>Ee("/api/v1/app/projects"),refetchInterval:2e3,enabled:e}).data;$.useEffect(()=>{if(!s)return;const r=ko();for(const a of B8(s.projects,uo(r))){if(D8(r,a.id),gm()!=="on"||xm()!=="granted"||!_k(`setup/${a.id}`,Date.now(),r))continue;const{title:o,body:c}=W8(a.name);tb(o,c,`setup/${a.id}`,()=>window.location.assign(`/p/${encodeURIComponent(a.id)}/overview`))}},[s])}function vo(e=""){return Pe({queryKey:["conversations",e],queryFn:()=>Ee(`/api/v1/conversations${e?`?q=${encodeURIComponent(e)}`:""}`),refetchInterval:1500})}function vm(e,n){if(!e.open)return 0;const s=n[e.id];return s===void 0?e.fresh:Math.min(e.fresh,Math.max(0,e.count-s))}function vR(){const e=fu(),n=Vi(Ki),s=vo();return!n&&!e.min&&(s.data??[]).some(r=>r.open)}function jR(e){const n=at[e.with];return e.thinking?`The ${n} is typing on ${e.id}`:e.yourTurn?`The ${n} answered on ${e.id}`:`${n} on ${e.id}`}function bR(){const e=fu(),n=Vi(Ki),s=rn(),r=vo(),[a,o]=$.useState(null),c=$.useRef(null),u=(r.data??[]).filter(m=>m.open),d=u.find(m=>m.id===e.tab)??u[0];if($.useEffect(()=>{c.current?.querySelector(".ctab.on")?.scrollIntoView({block:"nearest",inline:"nearest"})},[d?.id,e.min]),!d)return null;const p=m=>void s({to:"/conversations",search:{ticket:m}});if(e.min||n){const m=u.find(y=>y.thinking)??u.find(y=>y.yourTurn)??d;return t.jsxs("div",{className:"cmini",role:"status",children:[t.jsx(An,{role:m.with,small:!0,live:m.thinking}),t.jsxs("div",{children:[t.jsxs("b",{children:[u.length," ",u.length===1?"conversation":"conversations"]}),t.jsx("small",{children:jR(m)})]}),t.jsx("button",{className:"btn pri sm",onClick:()=>n?p(m.id):rs.restore(),children:"Open"})]})}const f=m=>{m.preventDefault();const y=m.clientX,x=e.width,k=b=>rs.resize(x+(y-b.clientX)),v=()=>{window.removeEventListener("mousemove",k),window.removeEventListener("mouseup",v),document.body.classList.remove("cresizing")};document.body.classList.add("cresizing"),window.addEventListener("mousemove",k),window.addEventListener("mouseup",v)};return t.jsxs(t.Fragment,{children:[a&&t.jsx(om,{doc:a,onClose:()=>o(null)}),t.jsxs("section",{className:"cdock",style:{width:e.width},"aria-label":"Conversations",children:[t.jsx("span",{className:"cgrip",onMouseDown:f,"aria-hidden":"true"}),t.jsxs("div",{className:"ctabs",children:[t.jsx("div",{className:"ctabscroll",role:"tablist","aria-label":"Open conversations",ref:c,children:u.map(m=>{const y=m.id===d.id,x=vm(m,e.seen);return t.jsxs("button",{className:`ctab ${y?"on":""}`,role:"tab","aria-selected":y,onClick:()=>rs.pick(m.id),title:`${m.id} · ${m.title}`,children:[t.jsx(An,{role:m.with,small:!0}),t.jsx("span",{className:"tid",children:m.id}),t.jsx("span",{className:"tn",children:at[m.with]}),m.thinking&&!y&&t.jsxs("span",{className:`cdots sm c-${m.with}`,"aria-label":"Typing",children:[t.jsx("i",{}),t.jsx("i",{}),t.jsx("i",{})]}),x>0&&!y&&t.jsx("span",{className:"cbadge","aria-label":`${x} unread`,children:x})]},m.id)})}),t.jsx(nb,{}),t.jsx("span",{className:"grow"}),t.jsx("button",{className:"iconbtn",onClick:()=>p(d.id),"aria-label":"Open full screen",title:"Full screen",children:t.jsx(cu,{size:15})}),t.jsx("button",{className:"iconbtn",onClick:rs.minimize,"aria-label":"Minimize",title:"Minimize",children:t.jsx(Eo,{size:16})})]}),t.jsx(hm,{id:d.id,size:"panel",onOpenDoc:o},d.id)]})]})}function nb(){const e=Qe(),n=pe(),[s,r]=$.useState(!1),[a,o]=$.useState(""),[c,u]=$.useState("analyst"),d=(e.data?.ready?e.data.tickets:[]).filter(f=>!f.chat?.open&&!f.takenOver),p=()=>n.mutate({path:`/api/v1/tickets/${a}/chat/start`,body:{with:c}},{onSuccess:()=>{r(!1),rs.show(a)}});return t.jsxs("span",{className:"cmenu-w",children:[t.jsx("button",{className:"iconbtn",onClick:()=>r(!s),"aria-label":"Start a new conversation",title:"Start a new conversation","aria-expanded":s,children:t.jsx(Tt,{size:16})}),s&&t.jsxs("div",{className:"cmenu cnew",role:"dialog","aria-label":"Start a new conversation",children:[t.jsxs("label",{children:[t.jsx("span",{children:"Ticket"}),t.jsxs("select",{className:"input",value:a,onChange:f=>o(f.target.value),children:[t.jsx("option",{value:"",children:"Pick a ticket"}),d.map(f=>t.jsxs("option",{value:f.id,children:[f.id," · ",f.title]},f.id))]})]}),t.jsxs("label",{children:[t.jsx("span",{children:"Talk to"}),t.jsx("select",{className:"input",value:c,onChange:f=>u(f.target.value),children:Object.keys(at).map(f=>t.jsxs("option",{value:f,children:["The ",at[f]]},f))})]}),t.jsxs("div",{className:"cbtns",children:[t.jsx("button",{className:"btn pri sm",disabled:!a||n.isPending,onClick:p,children:"Start talking"}),t.jsx("button",{className:"btn sm",onClick:()=>r(!1),children:"Cancel"})]})]})]})}const sb=["app","usage-limit"];function rb(){return Pe({queryKey:sb,queryFn:()=>Ee("/api/v1/app/usage-limit"),refetchInterval:5e3})}function sf(){const{data:e}=rb(),n=zn(),{toast:s}=qe();if(!e?.pause||!e.text)return null;const r=async()=>{try{n.setQueryData(sb,await bt("/api/v1/app/usage-limit/try-now","POST")),n.invalidateQueries(),s("The squad carries on now. If the limit is still there, it waits again by itself.")}catch(a){s(a instanceof Error?a.message:String(a),"err")}};return t.jsxs("section",{className:"upd failed",role:"status","aria-label":"The usage limit is reached",children:[t.jsx("span",{className:"upd-ic",children:t.jsx(Ap,{size:16})}),t.jsxs("div",{className:"upd-main",children:[t.jsx("b",{className:"upd-title",children:e.text}),t.jsxs("span",{className:"upd-sub",children:["Every project waits, because they share one ",e.pause.name," account. Nothing is lost, and the wait does not count as a failed try.",e.pause.resetsAt?"":" squad-kit looks again every 10 minutes."]})]}),t.jsxs("div",{className:"upd-acts",children:[t.jsx("button",{className:"btn sm",onClick:()=>void r(),children:"Try now"}),t.jsx(se,{text:"squad try-now"})]})]})}function rf(){const{data:e}=Pe({queryKey:["app","save-trouble"],queryFn:()=>Ee("/api/v1/app/save-trouble"),refetchInterval:5e3});return e?.text?t.jsxs("section",{className:"upd failed",role:"alert","aria-label":"squad-kit cannot save its work",children:[t.jsx("span",{className:"upd-ic",children:t.jsx(L6,{size:16})}),t.jsxs("div",{className:"upd-main",children:[t.jsx("b",{className:"upd-title",children:e.text}),t.jsxs("span",{className:"upd-sub",children:["The squad waits meanwhile. ",e.projects.length>1?`${e.projects.length} projects wait.`:""]}),e.detail&&t.jsxs("details",{children:[t.jsx("summary",{className:"note",children:"For engineers"}),t.jsx("span",{className:"mono",style:{fontSize:12.5,whiteSpace:"pre-wrap"},children:e.detail})]})]})]}):null}function ib(e){return Pe({queryKey:["happened",e.id],queryFn:()=>Ee(`/api/v1/tickets/${e.id}/happened`),refetchInterval:e.live?5e3:15e3})}function Cu(e){const n=Math.max(0,Math.round(e));if(n<60)return`${Math.max(1,n)} s`;if(n<600)return n%60?`${Math.floor(n/60)} min ${n%60} s`:`${n/60} min`;if(n<3600)return`${Math.round(n/60)} min`;const s=Math.round(n%3600/60);return s?`${Math.floor(n/3600)} h ${s} min`:`${Math.floor(n/3600)} h`}function wR({t:e,onTab:n,onLog:s}){const r=ib(e);return r.data?r.data.steps.length?t.jsxs("div",{className:"happened",children:[r.data.steps.map((a,o)=>t.jsx(NR,{s:a,t:e,onTab:n,onLog:s},`${a.step}-${a.from??a.to??o}`)),t.jsx("p",{className:"note happened-foot",children:"Engineers: Full log shows every action the agents took, with commands, file changes and their exact words, and how to open each session in a terminal."})]}):t.jsx("p",{className:"note",children:"Nothing has happened yet. The first card comes when the first step ends, for example the Analyst's questions."}):t.jsx("p",{className:"note",children:r.isError?"Could not read what happened. It tries again by itself.":"Loading…"})}function NR({s:e,t:n,onTab:s,onLog:r}){const a=e.seconds!==void 0?Cu(e.seconds):"",o=[e.running?`now${a?` · ${a}`:""}`:a,...e.notes].filter(Boolean).join(" · ");return t.jsxs("article",{className:`hstep ${e.running?"now":""}`,"aria-label":e.name,children:[t.jsxs("div",{className:"hhd",children:[e.running?t.jsx("span",{className:"hring","aria-label":"Working now"}):t.jsx("span",{className:"hok","aria-label":"Done",children:t.jsx(xe,{size:11,strokeWidth:3})}),t.jsx("b",{children:e.name}),o&&t.jsx("span",{children:o}),t.jsx("span",{className:"grow"}),e.to&&!e.running&&t.jsx("span",{className:"hat",children:Rn(e.to)})]}),t.jsx("p",{className:"hsum",children:e.summary}),e.handedIn&&t.jsx(CR,{h:e.handedIn,tab:e.tab,onTab:s,ticket:n}),e.session&&(e.actions??0)>0&&t.jsxs("button",{className:"linkbtn hmore",onClick:()=>r(e.session),children:["What it looked at and said (",e.actions," ",e.actions===1?"action":"actions",")"]}),e.skipped?t.jsxs("div",{className:"hskip",children:[t.jsx(Eo,{size:12})," Skipped ",e.skipped===1?"one action":`${e.skipped} actions`," this step may not take (by design, nothing went wrong)"]}):null]})}const SR={plan:"Open it in Plan",changes:"See the changes",proof:"Open it in Proof"};function jm(e,n=3){const[s,r]=$.useState(!1),a=e.length-n;return{shown:s?e:e.slice(0,n),more:a>0?t.jsx("button",{className:"linkbtn",onClick:()=>r(!s),children:s?"Show less":`+${a} more`}):null}}function CR({h:e,tab:n,onTab:s,ticket:r}){if(e.kind==="verdict")return t.jsx("div",{className:"hverdict",children:t.jsx(Wy,{h:e,ticket:r})});const a=n&&s?t.jsx("button",{className:"linkbtn",onClick:()=>s(n),children:e.kind==="checks"?"See them in Proof":SR[n]}):null;return t.jsxs("div",{className:"hgot",children:[t.jsx("b",{children:"Handed in"}),t.jsx(Wy,{h:e,ticket:r}),a&&t.jsx("div",{className:"hlink",children:a})]})}function Wy({h:e,ticket:n}){switch(e.kind){case"questions":return t.jsx($R,{items:e.items});case"spec":return t.jsx(ER,{story:e.story,criteria:e.criteria});case"design":return t.jsx(TR,{h:e});case"files":return t.jsx(AR,{h:e});case"checks":return t.jsxs("span",{children:[t.jsx("span",{className:`pill ${e.ok?"ok":"bug"}`,children:e.ok?"Pass":"Failed"})," ",e.text]});case"verdict":return t.jsxs("span",{children:[t.jsx("span",{className:`pill ${e.approved?"ok":"you"}`,children:e.approved?"Approved":"Asked for fixes"}),e.notes.length>0&&t.jsx("ul",{className:"hlist",children:e.notes.map((s,r)=>t.jsx("li",{children:s},r))})]});case"shots":return t.jsx(PR,{shots:e.shots,ticket:n})}}function $R({items:e}){const{shown:n,more:s}=jm(e);return t.jsxs(t.Fragment,{children:[t.jsx("ol",{className:"hlist",children:n.map((r,a)=>t.jsxs("li",{children:[r.text,r.answer&&t.jsxs("span",{className:"hans",children:["You: ",r.answer]})]},a))}),s]})}function ER({story:e,criteria:n}){const{shown:s,more:r}=jm(n);return t.jsxs(t.Fragment,{children:[e&&t.jsx("p",{className:"hstory",children:e}),n.length>0&&t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"hsub",children:"Done when"}),t.jsx("ul",{className:"hlist",children:s.map((a,o)=>t.jsx("li",{children:a},o))}),r]})]})}function TR({h:e}){const{shown:n,more:s}=jm(e.steps),r=[e.mockup?"With a mockup":"",e.follows.length?`Follows ${e.follows.join(", ")}`:"",e.adr?`Saved as ${e.adr}`:""].filter(Boolean);return t.jsxs(t.Fragment,{children:[e.title&&t.jsxs("p",{className:"hstory",children:[t.jsx("b",{children:e.title}),e.chosen?`: ${e.chosen}`:""]}),e.steps.length>0&&t.jsxs(t.Fragment,{children:[t.jsxs("span",{className:"hsub",children:[e.steps.length," ",e.steps.length===1?"step":"steps"," to build"]}),t.jsx("ol",{className:"hlist",children:n.map((a,o)=>t.jsx("li",{children:a},o))}),s]}),r.length>0&&t.jsx("span",{className:"hsub",children:r.join(" · ")})]})}function AR({h:e}){const n=[["New",e.added],["Changed",e.changed],["Removed",e.removed]].filter(([,s])=>s.length);return n.length?t.jsx("span",{className:"hfiles",children:n.map(([s,r])=>t.jsxs("span",{children:[s,": ",t.jsx("span",{className:"mono",children:r.slice(0,8).join(", ")}),r.length>8?` and ${r.length-8} more`:""]},s))}):t.jsx("ol",{className:"hlist",children:e.steps.map((s,r)=>t.jsx("li",{children:s},r))})}function PR({shots:e,ticket:n}){const[s,r]=$.useState(null),a=e.map(o=>({src:Cs(`/api/v1/proof/${o.file}`),caption:o.criterion}));return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"hshots",children:a.map((o,c)=>t.jsxs("button",{className:"zoom",onClick:()=>r(c),"aria-label":`Open the screenshot for ${o.caption} full size`,children:[t.jsx("img",{src:o.src,alt:`${n.id}: ${o.caption}`,loading:"lazy"}),t.jsx("small",{children:o.caption})]},o.src))}),s!==null&&t.jsx(Gr,{pictures:a,start:s,onClose:()=>r(null)})]})}const RR={questions:"Questions",spec:"Spec",scan:"Reading the project",design:"Design",blueprint:"Stack and patterns",build:"Build",fix:"Fixes",review:"Review",proof:"Proof",chat:"Talking it through",draft:"Filling in a new ticket"},IR=["analyst","architect","builder","reviewer","tester"];function bm(e){return e?.payment==="api-key"?"What the work cost on your API key, at its prices.":`What the work would cost at API prices. Your ${e?.name??"AI"} plan covers it, so this is a value, not a bill.`}function ab(e,n){e.runs+=n.runs;for(const s of["inputTokens","cachedTokens","outputTokens","costUsd"])n[s]!==void 0&&(e[s]=(e[s]??0)+n[s]);n.tokensUnknown&&(e.tokensUnknown=(e.tokensUnknown??0)+n.tokensUnknown),n.costUnknown&&(e.costUnknown=(e.costUnknown??0)+n.costUnknown)}function wm(e){const n={runs:0};for(const s of e)ab(n,s);return n}function ob(e){return IR.flatMap(n=>{const s=e.filter(a=>a.role===n);if(!s.length)return[];const r=[];for(const a of s){let o=r.find(c=>c.level===a.level&&c.model===a.model);o||r.push(o={level:a.level,model:a.model,steps:[],total:{runs:0}}),o.steps.includes(a.step)||o.steps.push(a.step),ab(o.total,a)}return[{role:n,total:wm(s),levels:r}]})}function Oi(e){return e.costUsd===void 0?null:e.costUsd<.005?"under $0.01":`$${e.costUsd.toFixed(2)}`}function uc(e){return e>=1e6?`${(e/1e6).toFixed(e>=1e7?0:1)}M`:e>=1e3?`${(e/1e3).toFixed(e>=1e4?0:1)}k`:String(e)}const af=e=>`${e} ${e===1?"run":"runs"}`;function Uy({t:e}){const n=Oi(e);return n?t.jsxs("span",{title:e.costUnknown?`${af(e.costUnknown)} did not report a cost, so the real amount is higher`:void 0,children:[n,e.costUnknown?t.jsxs("span",{className:"note",children:[" +",e.costUnknown," not reported"]}):null]}):t.jsx("span",{className:"note",children:"Not reported"})}function Hy({t:e}){if(e.inputTokens===void 0&&e.outputTokens===void 0)return t.jsx("span",{className:"note",children:"Not reported"});const n=e.cachedTokens?`, ${uc(e.cachedTokens)} of it read again from earlier in the conversation, which costs less`:"";return t.jsxs("span",{title:`Tokens are the pieces of text the AI reads and writes. It read ${uc(e.inputTokens??0)}${n}.`,children:[e.inputTokens!==void 0&&t.jsxs(t.Fragment,{children:[uc(e.inputTokens)," read"]}),e.inputTokens!==void 0&&e.outputTokens!==void 0&&" · ",e.outputTokens!==void 0&&t.jsxs(t.Fragment,{children:[uc(e.outputTokens)," written"]})]})}function zR({level:e,model:n}){return n?t.jsxs(t.Fragment,{children:[n," ",t.jsx("span",{className:"note",children:e})]}):t.jsx(t.Fragment,{children:e})}function Nm({roles:e,total:n,steps:s}){return t.jsxs("table",{className:"table usage",children:[t.jsx("thead",{children:t.jsxs("tr",{children:[t.jsx("th",{children:"Role"}),t.jsx("th",{children:"Model level"}),t.jsx("th",{children:s?"What it did":"Runs"}),t.jsx("th",{children:"Tokens"}),t.jsx("th",{className:"num",children:"Cost"})]})}),t.jsx("tbody",{children:e.flatMap(r=>r.levels.map((a,o)=>t.jsxs("tr",{children:[t.jsx("td",{children:o===0&&t.jsxs("span",{className:"who",children:[t.jsx(Hr,{role:r.role,small:!0})," ",$s[r.role]]})}),t.jsx("td",{children:t.jsx(zR,{level:a.level,model:a.model})}),t.jsx("td",{children:s?t.jsxs(t.Fragment,{children:[a.steps.map(c=>RR[c]??c).join(", "),t.jsxs("span",{className:"note",children:[" · ",af(a.total.runs)]})]}):a.total.runs}),t.jsx("td",{children:t.jsx(Hy,{t:a.total})}),t.jsx("td",{className:"num",children:t.jsx(Uy,{t:a.total})})]},`${r.role}-${a.level}-${a.model}`)))}),t.jsx("tfoot",{children:t.jsxs("tr",{children:[t.jsx("td",{children:"Total"}),t.jsx("td",{}),t.jsx("td",{children:s?t.jsx("span",{className:"note",children:af(n.runs)}):n.runs}),t.jsx("td",{children:t.jsx(Hy,{t:n})}),t.jsx("td",{className:"num",children:t.jsx(Uy,{t:n})})]})})]})}function Zi(){return Pe({queryKey:["cost"],queryFn:()=>Ee("/api/v1/cost"),refetchInterval:1e4})}function MR({t:e}){const n=Zi().data?.payment,s=e.usage??[],r=wm(s),a=Oi(r);return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"lbl",children:["What it used",s.length>0&&t.jsx("span",{className:"pill",children:a?n?.payment==="api-key"?`${a} on your API key`:`Included in your plan · ${a} value`:"Cost not reported"})]}),s.length?t.jsxs(t.Fragment,{children:[t.jsx(Nm,{roles:ob(s),total:r,steps:!0}),t.jsxs("p",{className:"note",style:{marginTop:8},children:[bm(n)," Each role's model level can be changed on the Squad page."]})]}):t.jsx("p",{className:"note",children:"Nothing yet. Each run of a role is counted here as the squad works."})]})}function lb(){return Pe({queryKey:["usage"],queryFn:()=>Ee("/api/v1/usage"),refetchInterval:5e3})}function FR(){const e=lb().data?.total,n=Zi().data?.payment;return e?.runs?t.jsx("span",{title:bm(n),children:n?.payment==="api-key"?t.jsxs(t.Fragment,{children:["Used ",t.jsx("b",{children:Oi(e)??"an unknown amount"})," on your API key"]}):t.jsxs(t.Fragment,{children:[t.jsx("b",{children:Oi(e)??"An unknown amount"})," of AI work, included in your plan"]})}):null}function LR(){const e=lb().data,n=Zi().data?.payment;return e?.total.runs?t.jsxs(t.Fragment,{children:[t.jsx("h2",{style:{marginTop:30},children:"What the squad used"}),t.jsxs("p",{className:"note",style:{marginTop:2},children:["Every ticket on this computer (",e.tickets," so far) and the project's own work, like reading the project and filling in new tickets",e.project.runs?` (${Oi(e.project)??"cost not reported"})`:"",e.deleted?.tickets?`, and ${e.deleted.tickets} deleted ${e.deleted.tickets===1?"ticket":"tickets"} (${Oi(e.deleted.total)??"cost not reported"})`:"",". ",bm(n)," Change a role's model level with its Edit button above."]}),t.jsx("div",{style:{marginTop:10},children:t.jsx(Nm,{roles:e.roles,total:e.total})})]}):null}const Un=e=>e<.005?"under $0.01":`$${e.toFixed(2)}`,jo=e=>e>0&&e<.01?"under 1%":`${Math.round(e*100)}%`;function _R({t:e}){const n=Pe({queryKey:["cost",e.id],queryFn:()=>Ee(`/api/v1/tickets/${e.id}/cost`),refetchInterval:e.live?5e3:2e4}),s=n.data;return s?s.total.runs?t.jsxs("div",{className:"costs",children:[t.jsx(Vy,{c:s}),t.jsxs("section",{className:"costcard",children:[t.jsx("h3",{children:"Size of the work"}),s.size?t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"sizes",role:"img","aria-label":`Size: ${s.size.size}`,children:["small","medium","large"].map(r=>t.jsx("span",{className:r===s.size.size?"on":"",children:r[0].toUpperCase()+r.slice(1)},r))}),t.jsxs("p",{children:[s.size.words," ",s.why]})]}):t.jsxs("p",{children:["This is one of the first tickets in ",s.project,", so there is no usual size to compare with yet. It shows once two tickets are accepted.",s.why?` ${s.why}`:""]}),s.seconds!==void 0&&t.jsxs("p",{className:"note",children:["The squad worked on it for ",Cu(s.seconds),", not counting the time it waited for you."]})]}),s.where.parts.length>0&&t.jsxs("section",{className:"costcard",children:[t.jsx("h3",{children:"Where the work went"}),t.jsx("div",{className:"wbars",children:s.where.parts.map(r=>t.jsxs("div",{className:"wbar",children:[t.jsx("span",{children:r.name}),t.jsxs("span",{className:"wbarline",children:[t.jsx("i",{style:{width:`${Math.max(2,Math.round(r.share*100))}%`}}),t.jsxs("small",{children:[jo(r.share),s.payment.payment==="api-key"&&r.costUsd!==void 0?` · ${Un(r.costUsd)}`:""]})]})]},r.name))}),t.jsxs("p",{className:"note",children:[s.where.by==="tokens"?"By the amount of text the AI read and wrote, because some steps did not report a cost. ":"","Thinking steps use the strongest model on purpose: a mistake there costs the most to fix later."]})]}),s.payment.payment==="subscription"?t.jsxs("section",{className:"costcard",children:[t.jsx("h3",{children:"Value of the AI work"}),t.jsxs("p",{children:[s.total.costUsd!==void 0?t.jsxs(t.Fragment,{children:[t.jsx("b",{className:"bigusd",children:Un(s.total.costUsd)})," at API prices, covered by your plan."]}):"The AI tool did not report what this work is worth."," ","This month the squad did ",t.jsx("b",{children:Un(s.month.total.costUsd??0)})," of AI work for ",s.project,"."]}),t.jsxs("p",{className:"note",children:["This is a value, not a bill: what the same work would cost if you paid per use.",s.total.costUnknown?` ${s.total.costUnknown} of its steps did not report one.`:""]})]}):null,s.tip&&t.jsxs("section",{className:"costcard tip",children:[t.jsx("h3",{children:"Small change next time?"}),t.jsxs("p",{children:[s.tip,s.payment.payment==="subscription"?" If your plan's usage limit is reached, squad-kit pauses and carries on by itself when it resets.":""]})]}),t.jsxs("details",{className:"costdetails",children:[t.jsx("summary",{children:"Details for engineers"}),t.jsxs("p",{className:"note",children:[s.details.models,s.details.tokens?`. ${s.details.tokens}.`:"."]}),t.jsx(Nm,{roles:ob(e.usage??[]),total:wm(e.usage??[]),steps:!0}),t.jsx("div",{style:{marginTop:8},children:t.jsx(se,{text:`squad cost ${e.id}`})})]})]}):t.jsxs("div",{className:"costs",children:[t.jsx(Vy,{c:s}),t.jsx("p",{className:"note",children:"Nothing used yet. Each step the squad takes is counted here."})]}):t.jsx("p",{className:"note",children:n.isError?"Could not read the cost. It tries again by itself.":"Loading…"})}function Vy({c:e}){if(e.payment.payment==="subscription")return t.jsxs("section",{className:"costcard paid",children:[t.jsxs("div",{className:"paidhead",children:[t.jsx("span",{className:"paidic",children:t.jsx(xe,{size:15,strokeWidth:2.6})}),t.jsxs("b",{children:["Included in your ",e.payment.name," plan. No extra charge."]})]}),t.jsxs("p",{className:"muted",children:["You pay for ",e.payment.name," with a subscription, so this ticket cost you nothing extra."," ",e.payment.from==="guess"&&"squad-kit could not tell how you pay, so it shows it this way. ",t.jsx(Te,{to:"/settings",children:"Pay with an API key instead?"})]})]});const n=e.budget;return t.jsxs("section",{className:`costcard ${n?.over.length?"over":n?.warn.length?"warn":""}`,children:[t.jsxs("div",{className:"paidhead",children:[t.jsx("span",{className:"paidic money",children:t.jsx(Sk,{size:15})}),t.jsxs("b",{children:[e.total.runs?e.total.costUsd!==void 0?Un(e.total.costUsd):"Not reported":"$0.00"," on your API key",e.total.costUnknown?t.jsxs("span",{className:"note",children:[" + ",e.total.costUnknown," steps not reported"]}):null]})]}),t.jsxs("p",{className:"muted",children:["Real money: each step is paid per use",e.payment.found?.kind==="api-key"?`, on your ${e.payment.found.label}`:"",". ",t.jsx(Te,{to:"/settings",children:"Pay with a subscription instead?"})]}),n&&t.jsx(OR,{b:n,project:e.project})]})}function Ky({share:e}){return t.jsx("span",{className:`meter ${e>=1?"over":e>=.8?"warn":""}`,role:"img","aria-label":jo(e),children:t.jsx("i",{style:{width:`${Math.min(100,Math.round(e*100))}%`}})})}function OR({b:e,project:n}){return!e.ticketUsd&&!e.monthUsd?t.jsxs("p",{className:"note",children:["This month: ",Un(e.monthSpent)," for ",n,". No budget yet: ",t.jsx(Te,{to:"/settings",children:"set one per ticket and per month"}),", and squad-kit warns you at 80%."]}):t.jsxs("div",{className:"budgets",children:[e.ticketUsd&&e.ticketShare!==void 0&&t.jsxs("div",{className:"budgetrow",children:[t.jsxs("span",{children:[jo(e.ticketShare)," of this ticket's ",Un(e.ticketUsd)," budget"]}),t.jsx(Ky,{share:e.ticketShare})]}),e.monthUsd&&e.monthShare!==void 0&&t.jsxs("div",{className:"budgetrow",children:[t.jsxs("span",{children:["This month: ",Un(e.monthSpent)," of your ",Un(e.monthUsd)," for ",n]}),t.jsx(Ky,{share:e.monthShare})]}),[...e.over,...e.warn].map(s=>t.jsxs("p",{className:"budgetsay",children:[t.jsx(dr,{size:14}),e.over.includes(s)?s==="ticket"?"Over its budget. Before its next step the ticket waits for you: carry on, do the rest yourself, or make the plan smaller. No step is cut in half.":"Over this month's budget. Each ticket waits for you before its next step. No step is cut in half.":s==="ticket"?"At 80% of its budget. At 100% the ticket waits for you before its next step.":"At 80% of this month's budget. At 100% tickets wait for you before their next step."]},s))]})}function qR(){const e=Zi().data,[n,s]=$.useState(()=>{try{return JSON.parse(sessionStorage.getItem("squad-budget-hidden")??"[]")}catch{return[]}});if($.useEffect(()=>{try{sessionStorage.setItem("squad-budget-hidden",JSON.stringify(n))}catch{}},[n]),!e||e.payment.payment!=="api-key")return null;const r=u=>`${u.kind}:${u.id??e.month.month}:${u.over?"over":"warn"}`,a=e.warnings.filter(u=>!n.includes(r(u)));if(!a.length)return null;const o=a[0],c=u=>u.kind==="month"?`This month the squad used ${jo(u.share)} of your ${Un(u.limit)} budget for ${e.project}${u.over?". Tickets wait for you before their next step":""}`:`${u.id} ${u.title} used ${jo(u.share)} of its ${Un(u.limit)} budget${u.over?". It waits for you before its next step":""}`;return t.jsxs("section",{className:"upd failed budgetbar",role:"status","aria-label":"Budget",children:[t.jsx("span",{className:"upd-ic",children:t.jsx(Sk,{size:16})}),t.jsxs("div",{className:"upd-main",children:[t.jsx("b",{className:"upd-title",children:c(o)}),t.jsxs("span",{className:"upd-sub",children:[a.length>1?`And ${a.length-1} more near a budget. `:"","At 100% a ticket waits for you between two steps, never in the middle of one."]})]}),t.jsxs("div",{className:"upd-acts",children:[o.id&&t.jsxs(Te,{to:"/board",search:{ticket:o.id},className:"btn sm",children:["Open ",o.id]}),t.jsx(Te,{to:"/settings",className:"btn sm",children:"Budgets"}),t.jsx("button",{className:"iconbtn","aria-label":"Hide this notice",onClick:()=>s([...n,...a.map(r)]),children:t.jsx(Xe,{size:14})})]})]})}function DR(){const e=Zi().data,n=pe(),[s,r]=$.useState(""),[a,o]=$.useState(""),c=e?.budget;if($.useEffect(()=>{r(c?.ticketUsd?String(c.ticketUsd):""),o(c?.monthUsd?String(c.monthUsd):"")},[c?.ticketUsd,c?.monthUsd]),!e)return null;const u=e.payment,d=(f,m)=>n.mutate({path:"/api/v1/cost/payment",method:"PUT",body:{payment:f},done:m}),p=u.found?`${u.tool} is signed in with ${u.found.label}${u.found.kind==="subscription"?", a subscription":", paid per use"}.`:`squad-kit could not tell how ${u.tool} is paid.`;return t.jsxs("div",{style:{margin:"22px 0 26px"},children:[t.jsx("h2",{children:"How you pay for the AI"}),t.jsxs("p",{className:"note",style:{margin:"2px 0 10px"},children:[p," ",u.from==="you"?"You chose below, and your choice wins.":"Change it below if that is not right."," It decides what the Cost tab shows."]}),t.jsxs("div",{className:"maprow",style:{alignItems:"center"},children:[t.jsx("b",{children:"You pay with"}),t.jsxs("span",{style:{display:"flex",gap:6,alignItems:"center",flexWrap:"wrap"},children:[t.jsx("button",{className:`btn sm ${u.payment==="subscription"&&u.from==="you"?"pri":""}`,"aria-pressed":u.payment==="subscription"&&u.from==="you",onClick:()=>d("subscription","A subscription: the Cost tab shows the value of the work, with no extra charge"),children:"A subscription"}),t.jsx("button",{className:`btn sm ${u.payment==="api-key"&&u.from==="you"?"pri":""}`,"aria-pressed":u.payment==="api-key"&&u.from==="you",onClick:()=>d("api-key","An API key: the Cost tab shows real dollars and budgets"),children:"An API key"}),t.jsx("button",{className:`btn sm ${u.from!=="you"?"pri":""}`,"aria-pressed":u.from!=="you",onClick:()=>d("auto","squad-kit finds out how you pay"),children:"Find out for me"}),t.jsx("span",{className:"grow"}),t.jsx(se,{text:`squad config set payment ${u.from==="you"?u.payment:"auto"}`})]})]}),u.payment==="api-key"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"maprow",style:{alignItems:"center"},children:[t.jsx("b",{children:"Budget per ticket"}),t.jsxs("span",{className:"moneyin",children:["$",t.jsx("input",{className:"input",inputMode:"decimal",value:s,placeholder:"No budget",onChange:f=>r(f.target.value),"aria-label":"Budget per ticket, in US dollars"})]})]}),t.jsxs("div",{className:"maprow",style:{alignItems:"center"},children:[t.jsx("b",{children:"Budget per month"}),t.jsxs("span",{className:"moneyin",children:["$",t.jsx("input",{className:"input",inputMode:"decimal",value:a,placeholder:"No budget",onChange:f=>o(f.target.value),"aria-label":"Budget per month, in US dollars"}),t.jsxs("span",{className:"note",children:["for ",e.project,", on this computer"]})]})]}),t.jsxs("div",{style:{marginTop:10,display:"flex",gap:10,alignItems:"center",flexWrap:"wrap"},children:[t.jsx("button",{className:"btn pri sm",disabled:n.isPending,onClick:()=>n.mutate({path:"/api/v1/cost/budget",method:"PUT",body:{ticketUsd:s.trim()||null,monthUsd:a.trim()||null},done:"Budgets saved"}),children:"Save budgets"}),t.jsx("span",{className:"note",children:"At 80% the ticket and the board say so. At 100% the ticket waits for you between two steps, never in the middle of one."}),t.jsx(se,{text:`squad config set budget --ticket ${s.trim()||"off"} --month ${a.trim()||"off"}`})]})]})]})}const BR={best:"Best",balanced:"Balanced",thrifty:"Thrifty"};function WR(){const e=Zi().data;if(!e)return null;const n=e.quality.some(s=>s.tickets>0);return t.jsxs("div",{className:"maprow",children:[t.jsxs("b",{style:{paddingTop:2},children:["On ",e.project]}),t.jsxs("span",{className:"qstats",children:[!n&&t.jsxs("span",{className:"note",children:["Each Quality setting's average cost and time per accepted ticket shows here once ",e.qualityAfter," tickets are accepted with it."]}),n&&e.quality.map(s=>t.jsxs("span",{className:"qstat",children:[t.jsx("b",{children:BR[s.quality]}),s.tickets>=e.qualityAfter?t.jsxs("span",{children:[s.costUsd!==void 0?`${Un(s.costUsd)} ${e.payment.payment==="api-key"?"":"of AI work "}`:"",s.seconds!==void 0?`${s.costUsd!==void 0?"and ":""}${Cu(s.seconds)} of squad time `:"","per accepted ticket ",t.jsxs("span",{className:"note",children:["(",s.tickets," tickets)"]})]}):t.jsxs("span",{className:"note",children:["Shows after ",e.qualityAfter," accepted tickets (",s.tickets," so far)"]})]},s.quality)),n&&e.payment.payment==="subscription"&&t.jsx("span",{className:"note",children:"Values at API prices, covered by your plan."})]})]})}function UR(){const e=o8(),n=e.data?.apps??[];if(!n.length)return null;const s=n.some(r=>r.start&&(r.state==="not-running"||r.state==="stopped")&&!r.up&&!r.fresh);return t.jsxs("div",{className:"apps",children:[t.jsx("div",{className:"apps-h",children:"Your apps"}),n.map(r=>t.jsx(QR,{a:r,named:n.length>1,live:e.data?.live??!1,reading:e.data?.reading??!1,readError:e.data?.readError},r.repo)),s&&t.jsx("p",{className:"apps-note",children:"Starts the latest main, with every ticket you approved. No terminal needed."})]})}const HR=e=>(e??"").replace(/^https?:\/\//,"");function VR(e){const n=e.map(s=>`${s.id} ${s.title}`);return n.length>1?`${n.slice(0,-1).join(", ")} and ${n[n.length-1]}`:n[0]??""}function Yy(e){switch(e.state){case"running":return YR(e.since);case"starting":return"Starting…";case"stopped":return"Stopped";case"failed":return"Failed";default:return"Not running"}}function KR(e){return e.step==="setup"?"Setting it up first":e.step==="start"?"Starting it":`Getting the newest ${e.base}`}function YR(e){const n=e?Math.round((Date.now()-Date.parse(e))/6e4):0;return n<1?"Running":`Running for ${n} min`}function QR({a:e,named:n,live:s,reading:r,readError:a}){const o=pe(),[c,u]=$.useState(!1),[d,p]=$.useState(!1),f=n?` ${Hi(e.name)}`:"",m=(k,v,b)=>o.mutate({path:`/api/v1/apps/${encodeURIComponent(e.name)}/${k}`,body:b,done:v}),y=k=>m("start",`Starting ${e.name}`,k),x=e.state==="failed"?e.busy:void 0;return t.jsxs("div",{className:`app-item ${e.state}`,children:[e.fresh&&e.start&&t.jsxs("div",{className:"app-new",role:"status",children:[t.jsxs("div",{className:"hd",children:[t.jsx("span",{className:"ok",children:t.jsx(xe,{size:13,strokeWidth:3})}),t.jsxs("b",{title:e.fresh.title,children:[e.fresh.id," is in ",e.fresh.base]})]}),t.jsx("p",{children:"Try the new version yourself."}),t.jsxs("div",{className:"app-acts",children:[t.jsx("button",{className:"btn sm go",disabled:o.isPending,onClick:()=>m("restart",`Starting the new version of ${e.name}`),children:"Run the new version"}),t.jsx("button",{className:"btn sm",disabled:o.isPending,onClick:()=>m("not-now","Fine. It stays as it is.",{ticket:e.fresh.id}),children:"Not now"})]}),e.fresh.release&&t.jsxs("small",{children:["It also goes out in release ",e.fresh.release,"."]}),t.jsx(se,{text:`squad app restart${f}`})]}),t.jsxs("div",{className:"app-row",children:[t.jsx("i",{"aria-hidden":"true"}),t.jsxs("span",{className:"nm",children:[t.jsx("b",{children:e.name}),t.jsx("small",{title:e.state==="running"?`Running at ${e.address}`:Yy(e),children:Yy(e)})]}),e.state==="running"?t.jsx("a",{className:"btn sm pri",href:e.address,target:"_blank",rel:"noreferrer",title:`Open ${e.address}`,children:"Open"}):e.state==="starting"?t.jsx("button",{className:"btn sm",disabled:o.isPending,onClick:()=>m("stop",`Stopped ${e.name}`),children:"Stop"}):e.start?t.jsx("button",{className:"btn sm go",disabled:o.isPending,onClick:()=>y(),children:e.state==="failed"?"Try again":"Start"}):null]}),e.state==="starting"&&t.jsx("p",{className:"app-more",children:KR(e)}),e.state==="running"&&t.jsxs("div",{className:"app-more",children:[t.jsx("span",{className:"addr",children:HR(e.address)}),e.includes.length>0&&t.jsxs("span",{children:["Includes ",VR(e.includes)]}),e.elsewhere&&t.jsx("span",{children:"Started outside the board, from a terminal or an earlier squad-kit."}),t.jsxs("div",{className:"app-acts",children:[t.jsx("button",{className:"btn sm",disabled:o.isPending,onClick:()=>m("restart",`Restarting ${e.name}`),children:"Restart"}),t.jsx("button",{className:"btn sm",disabled:o.isPending,onClick:()=>m("stop",`Stopped ${e.name}`),children:"Stop"})]}),t.jsx(se,{text:`squad app stop${f}`})]}),e.state==="failed"&&!x&&t.jsx("p",{className:"app-more why",children:e.error}),e.state!=="running"&&e.state!=="starting"&&e.start&&!x&&t.jsx(se,{text:`squad app start${f}`}),e.state!=="running"&&e.state!=="starting"&&e.start&&e.up&&!x&&t.jsxs("p",{className:"app-more",children:["Something else answers at this app's address."," ",t.jsx("a",{href:e.url,target:"_blank",rel:"noreferrer",children:"Open it"})]}),x&&t.jsxs("div",{className:"app-warn",children:[t.jsx("b",{children:e.error}),t.jsx("span",{children:x.ours?"squad-kit started it, so it can stop it for you.":"squad-kit leaves it alone. Close that program, then press Try again, or ask an engineer to look at what failed."}),x.ours&&t.jsx("div",{className:"app-acts",children:t.jsx("button",{className:"btn sm",disabled:o.isPending,onClick:()=>y({stopOther:!0}),children:"Stop it and start"})}),t.jsx(se,{text:x.ours?`squad app start${f} --stop-other`:`squad app start${f}`})]}),!e.start&&!c&&t.jsxs("div",{className:"app-warn",children:[t.jsx("b",{children:"Start command unknown"}),t.jsx("span",{children:"squad-kit could not tell how to start this app yet."}),a&&!r&&t.jsxs("span",{className:"bad",children:["The Architect could not read the project: ",a]}),t.jsxs("div",{className:"app-acts",children:[s&&t.jsx("button",{className:"btn sm",disabled:r||o.isPending,onClick:()=>o.mutate({path:"/api/v1/scan",done:"The Architect is reading the project to find how to start it"}),children:r?"The Architect is looking…":"Ask the Architect to find it"}),t.jsx("button",{className:"btn sm",onClick:()=>u(!0),children:"Type it"})]}),!s&&t.jsx("span",{children:"You can also set it in Settings, under How the squad checks and runs this project."}),t.jsx(se,{text:s?"squad app find":`squad app set${f} --start "npm run dev"`})]}),c&&t.jsx(GR,{a:e,cmdRef:f,onDone:()=>u(!1)}),e.start&&t.jsx("button",{className:"app-link",onClick:()=>p(!0),children:e.state==="failed"?"See what failed":"Show output"}),d&&t.jsx(ZR,{a:e,cmdRef:f,onClose:()=>p(!1),onChange:()=>{p(!1),u(!0)}})]})}function GR({a:e,cmdRef:n,onDone:s}){const r=pe(),[a,o]=$.useState(e.start??""),[c,u]=$.useState(e.url??""),d=()=>r.mutate({path:`/api/v1/apps/${encodeURIComponent(e.name)}/commands`,method:"PUT",body:{start:a,url:c},done:`Saved how ${e.name} starts`},{onSuccess:s});return t.jsxs("form",{className:"app-type",onSubmit:p=>{p.preventDefault(),d()},children:[t.jsxs("label",{children:["Start command",t.jsx("input",{className:"input",value:a,onChange:p=>o(p.target.value),placeholder:"npm run dev",autoFocus:!0,spellCheck:!1})]}),t.jsxs("label",{children:["Address",t.jsx("input",{className:"input",value:c,onChange:p=>u(p.target.value),placeholder:"http://localhost:3000",spellCheck:!1})]}),t.jsxs("div",{className:"app-acts",children:[t.jsx("button",{className:"btn sm pri",type:"submit",disabled:!a.trim()||r.isPending,children:"Save"}),t.jsx("button",{className:"btn sm",type:"button",onClick:s,children:"Cancel"})]}),t.jsx(se,{text:`squad app set${n} --start ${Le(a.trim()||"npm run dev")}${c.trim()?` --url ${Hi(c.trim())}`:""}`})]})}function ZR({a:e,cmdRef:n,onClose:s,onChange:r}){const o=(Pe({queryKey:["apps",e.name,"output"],queryFn:()=>Ee(`/api/v1/apps/${encodeURIComponent(e.name)}/output`),refetchInterval:2e3}).data?.lines??[]).join(`
626
- `).trim();return t.jsxs(Ve,{title:e.state==="failed"?`${e.name}: what failed`:`${e.name}: how it starts`,wide:!0,onClose:s,footer:t.jsxs(t.Fragment,{children:[t.jsx(se,{text:`squad app start${n}`}),t.jsx("span",{className:"grow"}),t.jsx("button",{className:"btn sm",onClick:r,children:"Change"}),t.jsx("button",{className:"btn sm pri",onClick:s,children:"Done"})]}),children:[e.state==="failed"&&e.detail&&t.jsx("pre",{className:"app-out",style:{marginBottom:12},children:e.detail}),t.jsxs("div",{className:"app-how",children:[t.jsxs("div",{children:[t.jsx("span",{children:"Start command"}),t.jsx("code",{children:e.start})]}),t.jsxs("div",{children:[t.jsx("span",{children:"Address"}),t.jsx("code",{children:e.address??e.url??"The one it prints when it starts"})]}),e.setup&&t.jsxs("div",{children:[t.jsx("span",{children:"Setup, in a new copy and when its packages change"}),t.jsx("code",{children:e.setup})]}),t.jsxs("div",{children:[t.jsxs("span",{children:["squad-kit's copy of ",e.base]}),t.jsxs("code",{children:[e.dir,e.commit?` at ${e.commit.slice(0,8)}`:""]})]})]}),t.jsx("pre",{className:"app-out",children:o||"Nothing yet. Press Start, and what the app prints shows here."})]})}function XR({children:e}){const n=Ec({select:f=>f.location.pathname}),s=Ec({select:f=>f.location.search.ticket}),r=Vi(Ki),a=eI(),o=JR(n),c=n.startsWith("/board")&&!!s,[u,d]=$.useState(!1);$.useEffect(()=>d(!1),[s]);const p=c&&(r||a.is)&&o.length>0;return t.jsxs("div",{ref:a.ref,className:`banners ${p&&u?"unfolded":""}`,children:[p&&u&&t.jsxs("button",{className:"bless",onClick:()=>d(!1),"aria-expanded":!0,children:[t.jsx(ck,{size:14,"aria-hidden":!0})," Show less"]}),p&&!u&&t.jsxs("button",{className:"bslim",onClick:()=>d(!0),"aria-expanded":!1,"aria-label":`${o.map(f=>f.text).join(", ")}. Show the messages`,children:[t.jsx("span",{className:"bchips",children:o.map(f=>t.jsx("span",{className:`bchip ${f.tone}`,children:f.text},f.key))}),t.jsx(Cf,{size:16,"aria-hidden":!0})]}),t.jsx("div",{className:"banners-all",hidden:p&&!u,children:e})]})}function JR(e){const n=hu().data,s=rb().data,r=Qe().data,a=[],o=n?y8(n):null;o&&a.push({key:"update",text:o,tone:n?.progress.state==="failed"?"you":"acc"}),s?.pause&&s.text&&a.push({key:"limit",text:"Usage limit",tone:"you"}),r?.ready&&r.console?.outdated&&a.push({key:"restart",text:"Restart to update",tone:"you"});const c=Su().length,u=r?.ready&&!e.startsWith("/inbox")?r.tickets.filter(zo).length+c:0;return u&&a.push({key:"waiting",text:`${u} need${u===1?"s":""} you`,tone:"you"}),a}function eI(){const[e,n]=$.useState(!1),s=$.useRef(null),r=$.useCallback(a=>{s.current?.disconnect(),!(!a||typeof ResizeObserver>"u")&&(s.current=new ResizeObserver(([o])=>n((o?.contentRect.width??1/0)<820)),s.current.observe(a))},[]);return $.useEffect(()=>()=>s.current?.disconnect(),[]),{ref:r,is:e}}function $u(){return Pe({queryKey:["setup"],queryFn:()=>Ee("/api/v1/setup"),refetchInterval:e=>e.state.data?.setup&&!e.state.data.setup.ready&&!e.state.data.setup.approved?1e3:5e3})}function cb(e=1e3){const[n,s]=$.useState(Date.now);return $.useEffect(()=>{const r=setInterval(()=>s(Date.now()),e);return()=>clearInterval(r)},[e]),n}function tI({state:e}){return t.jsx("i",{className:`ob-mark ${e}`,"aria-hidden":!0,children:e==="done"?t.jsx(xe,{size:13,strokeWidth:3}):e==="failed"?"!":e==="skipped"?"–":e==="stopped"?t.jsx(us,{size:8,fill:"currentColor"}):e==="now"?t.jsx("span",{className:"live"}):null})}function nI({st:e,now:n}){const s=pe(),[r,a]=$.useState(!1),o=Mp(e,n);return t.jsxs("li",{className:`ob-step ${e.state}`,children:[t.jsx(tI,{state:e.state}),t.jsxs("span",{className:"ob-st-t",children:[t.jsx("b",{children:e.label}),e.note&&t.jsx("small",{title:e.note,children:e.note}),e.state==="now"&&t.jsx("span",{className:"setup-bar","aria-hidden":!0,children:t.jsx("i",{})}),e.error&&t.jsx("span",{className:"ob-err",children:e.error}),e.ways.length>0&&t.jsxs("span",{className:"ob-ways",children:[e.ways.map(c=>c.do==="again"?t.jsxs("span",{className:"ob-way",children:[t.jsx("button",{className:"btn sm",disabled:s.isPending,onClick:()=>s.mutate({path:"/api/v1/setup/again",body:{step:c.step},done:c.step==="read"?"The Architect reads the project again":"squad-kit tries it again"}),children:c.label}),t.jsx(se,{text:c.command})]},c.label):c.do==="output"?t.jsx("button",{className:"btn sm quiet",onClick:()=>a(!r),"aria-expanded":r,children:r?"Hide what failed":c.label},c.label):t.jsx(Te,{to:"/settings",className:"btn sm quiet",children:c.label},c.label)),e.state==="failed"&&(e.id==="read"||e.id==="tool")&&t.jsx(bu,{small:!0})]}),r&&e.output&&t.jsx("pre",{className:"ob-out",children:e.output})]}),t.jsxs("time",{className:"ob-time",children:[o,(e.state==="now"||e.state==="todo")&&t.jsx("small",{children:e.usual})]})]})}const sI=[{id:"best",name:"Best",note:"The strongest model builds and reviews. Uses your plan's limits faster."},{id:"balanced",name:"Balanced",note:"The strongest model at medium effort."},{id:"thrifty",name:"Thrifty",note:"A lighter model builds. Cheapest."}];function rI({s:e}){const n=pe(),[s,r]=$.useState(null);if(e.approved)return null;const a=s??e.quality;return t.jsxs("section",{className:"ob-quality","aria-label":"Quality",children:[t.jsxs("div",{className:"ob-q-h",children:[t.jsx("b",{children:"How strong should the squad be?"}),t.jsx("span",{className:"note",children:e.qualityAsked?"Saved. Change it any time in Settings.":"Asked once. You can change it any time in Settings."})]}),t.jsx("div",{className:"ob-q-opts",role:"radiogroup","aria-label":"Quality",children:sI.map(o=>t.jsxs("button",{role:"radio","aria-checked":o.id===a,className:`ob-q ${o.id===a?"on":""}`,onClick:()=>{r(o.id),n.mutate({path:"/api/v1/setup/quality",body:{quality:o.id},done:`Quality is ${o.name}. The squad uses it from its first step.`})},children:[t.jsxs("b",{children:[o.name,o.id==="best"&&t.jsx("small",{children:" · the default"})]}),t.jsx("span",{children:o.note})]},o.id))}),t.jsx(se,{text:`squad config set quality ${a}`})]})}function iI({s:e}){const n=km(),s=(()=>{try{return window.localStorage}catch{return null}})(),[r,a]=$.useState(()=>gt?uo(s).includes(gt):!1);return e.ready||e.approved||!gt?null:r&&n.on?t.jsxs("span",{className:"pill ok",children:[t.jsx(Ep,{size:13})," We will tell you when it is ready"]}):t.jsxs("button",{className:"btn",onClick:async()=>{n.on||await n.turnOn(),q8(s,gt),a(!0)},children:[t.jsx(Ep,{size:15})," Notify me when it is ready"]})}function aI({s:e}){const n=cb();return t.jsx("ol",{className:"ob-steps",children:e.steps.map(s=>t.jsx(nI,{st:s,now:n},s.id))})}function oI({s:e}){const[n,s]=$.useState(!1);return e.reads.length?t.jsxs("div",{className:"ob-reads",children:[t.jsxs("button",{className:"btn sm quiet",onClick:()=>s(!n),"aria-expanded":n,children:[n?t.jsx(ck,{size:14}):t.jsx(Cf,{size:14})," ",n?"Hide what the Architect read":"See what the Architect is reading"]}),n&&t.jsx("ul",{children:e.reads.map((r,a)=>t.jsx("li",{className:"mono",children:r},`${a}-${r}`))})]}):null}function ub(){const n=$u().data?.setup,s=cb();if(!n||n.approved)return null;if(n.ready)return t.jsxs("div",{className:"ob-card ready",children:[t.jsx("span",{className:"ob-ring",children:t.jsx(xe,{size:16,strokeWidth:2.5})}),t.jsxs("span",{className:"grow",children:[t.jsx("b",{children:n.empty?"One question for you":"Your project overview is ready"}),t.jsx("span",{children:n.empty?"What do you want to build?":"squad-kit has read your project. Check what it understood, then start working."})]}),t.jsxs(Te,{to:"/overview",className:"btn you sm",children:["Check it ",t.jsx(lo,{size:14})]})]});const r=n.steps.find(o=>o.id===n.current),a=n.steps.findIndex(o=>o.id===n.current)+1;return t.jsxs("div",{className:`ob-card ${r?.state==="failed"||r?.state==="stopped"?"stop":""}`,children:[t.jsxs("div",{className:"grow",children:[t.jsx("b",{children:"Getting to know your project"}),t.jsxs("span",{children:["Step ",a," of ",n.total,": ",r?.label??"starting",r&&Mp(r,s)?` · ${Mp(r,s)}`:""]}),r?.note&&r.state!=="todo"&&t.jsx("small",{title:r.note,children:r.note}),t.jsx("span",{className:"ob-dots","aria-hidden":!0,children:n.steps.map(o=>t.jsx("i",{className:o.state},o.id))})]}),t.jsxs(Te,{to:"/setup",className:"btn sm",children:["Open the setup ",t.jsx(lo,{size:14})]})]})}function lI(){const e=$u().data?.setup;return!!(e&&!e.approved)}function cI(){const e=$u().data?.setup;return!!(e?.ready&&!e.approved)}const uI=[{to:"/overview",label:"Overview",icon:dk,badge:"setup"},{to:"/requirements",label:"Requirements",icon:kk,badge:"reqs"},{to:"/board",label:"Board",icon:yk},{to:"/backlog",label:"Backlog",icon:W6},{to:"/inbox",label:"Waiting for you",icon:O6,badge:"you"},{to:"/conversations",label:"Conversations",icon:V6,badge:"chats"},{to:"/releases",label:"Releases",icon:os},{to:"/architecture",label:"Architecture",icon:Y6},{to:"/bugs",label:"Bugs",icon:Ts,badge:"bugs"},{to:"/squad",label:"Squad and AI",icon:Nk},{to:"/settings",label:"Settings",icon:Z6}];function dI(){const e=Qe(),{theme:n,toggleTheme:s,showCommands:r,toggleCommands:a}=qe(),o=Ec({select:S=>S.location.pathname}),c=e.data?.ready?e.data.meta:void 0,u=e.data?.ready?e.data.tickets:[],d=Su().length,p=u.filter(zo).length+d,f=u.filter(S=>S.kind==="bug").length,m=(c?.user.name??"You").slice(0,2).toUpperCase(),y=vo().data?.filter(S=>S.open).length??0,x=vR(),k=cI(),v=Rj(5e3),b=f7(v.data?.breakdowns??[],c?.user.name),[N,C]=$.useState(!1);return $.useEffect(()=>C(!1),[o]),o.startsWith("/conversations")||o.startsWith("/setup")?t.jsxs("div",{className:"fullpage",children:[t.jsx(rf,{}),t.jsx(sf,{}),t.jsx(Dy,{}),t.jsx("div",{className:"canvas-b",children:t.jsx($p,{})})]}):t.jsxs("div",{className:`app ${x?"docked":""}`,children:[t.jsxs("header",{className:"mtop",children:[t.jsx("button",{className:"iconbtn",onClick:()=>C(!0),"aria-label":"Open the menu","aria-expanded":N,children:t.jsx(H6,{size:17})}),t.jsx("b",{children:c?.project??"Your project"}),p>0&&t.jsx(Te,{to:"/inbox",className:"badge you","aria-label":`${p} waiting for you`,children:p})]}),N&&t.jsx("div",{className:"side-veil",onClick:()=>C(!1)}),t.jsxs("aside",{className:`side ${N?"open":""}`,children:[t.jsxs("a",{className:"brand",href:"/",title:"All your projects",children:[t.jsx("img",{src:"/logo.svg",alt:""}),t.jsx("b",{children:"squad-kit"}),c?.engine==="demo"&&t.jsx("small",{title:"The squad plays back a recorded run",children:"Demo"})]}),t.jsxs("a",{className:"proj",href:"/",title:"All your projects",children:[t.jsx("span",{className:"pm",children:(c?.project??"P").charAt(0)}),t.jsxs("div",{children:[t.jsx("b",{children:c?.project??"Your project"}),t.jsxs("span",{children:[u.length," open tickets"]})]}),t.jsx(T6,{size:14,className:"sw"})]}),uI.map(S=>{const P=S.badge==="you"?p:S.badge==="bugs"?f:S.badge==="chats"?y:0;if(S.badge==="setup")return t.jsxs(Te,{to:S.to,className:`nav ${o.startsWith(S.to)?"on":""}`,onClick:()=>C(!1),children:[t.jsx(S.icon,{size:16}),S.label,k&&t.jsx("span",{className:"badge you","aria-label":"Waits for you",children:"1"})]},S.to);if(S.badge==="reqs")return t.jsxs(Te,{to:S.to,className:`nav ${o.startsWith(S.to)?"on":""}`,onClick:()=>C(!1),children:[t.jsx(S.icon,{size:16}),S.label,b>0?t.jsx("span",{className:"badge you","aria-label":`${b} ${b===1?"needs":"need"} you`,children:b}):t.jsx("span",{className:"badge new",children:"New"})]},S.to);const M=o.startsWith(S.to)||S.to==="/inbox"&&o.endsWith("/proof");return t.jsxs(Te,{to:S.to,className:`nav ${M?"on":""}`,onClick:()=>C(!1),children:[t.jsx(S.icon,{size:16}),S.label,P>0&&t.jsx("span",{className:`badge ${S.badge==="you"?"you":S.badge==="chats"?"talk":""}`,children:P})]},S.to)}),t.jsx("div",{className:"grow"}),t.jsx(UR,{}),t.jsx("div",{className:"engines",children:(c?.tools??[]).map(S=>t.jsxs("div",{className:"row",children:[t.jsx("span",{children:S.name}),t.jsx("span",{className:`dot ${S.ready?"":"off"}`,children:S.ready?"Ready":"Not installed"})]},S.name))}),t.jsxs("button",{className:"switch",onClick:a,"aria-pressed":r,children:[t.jsxs("span",{children:[t.jsx(_c,{size:15}),"Show commands"]}),t.jsx("span",{className:`tog ${r?"on":""}`})]}),t.jsxs("div",{className:"me",children:[t.jsx("span",{className:"av",children:m}),t.jsxs("div",{children:[c?.user.name??"You",t.jsx("small",{children:c?.user.role??""})]}),t.jsx("button",{className:"theme",onClick:s,"aria-label":n==="light"?"Switch to dark":"Switch to light",children:n==="light"?t.jsx(To,{size:15}):t.jsx(Ao,{size:15})})]})]}),t.jsxs("main",{className:"canvas",children:[t.jsxs(XR,{children:[t.jsx(rf,{}),t.jsx(Mk,{}),t.jsx(sf,{}),e.data?.ready&&t.jsx(qR,{}),e.data?.ready&&e.data.console?.outdated&&t.jsx(c8,{}),t.jsx(Dy,{})]}),t.jsx("div",{className:"canvas-b",children:t.jsx($p,{})})]}),t.jsx(bR,{})]})}function db({error:e,reset:n}){const s=e instanceof Error?e.stack??e.message:String(e);return t.jsx("div",{className:"center",role:"alert",style:{padding:24},children:t.jsxs("div",{style:{maxWidth:520},children:[t.jsxs("h2",{children:[t.jsx(dr,{size:18,style:{verticalAlign:"-3px",marginRight:8}}),"This page ran into a problem"]}),t.jsx("p",{children:"Your work is safe, and so is what you typed. Try again, or go on from the board."}),t.jsxs("div",{style:{display:"flex",gap:10,flexWrap:"wrap",marginTop:12},children:[t.jsx("button",{className:"btn pri",onClick:()=>n?n():window.location.reload(),children:"Try again"}),t.jsx("a",{className:"btn",href:`${zi}/board`,children:"Go to the board"}),t.jsx("button",{className:"btn",onClick:()=>Po.open({}),children:"Report a problem"})]}),t.jsxs("details",{style:{marginTop:14},children:[t.jsx("summary",{className:"note",children:"For engineers"}),t.jsx("pre",{className:"mono",style:{fontSize:12,whiteSpace:"pre-wrap",overflowWrap:"anywhere"},children:s})]})]})})}class Qy extends $.Component{state={error:null};static getDerivedStateFromError(n){return{error:n}}componentDidCatch(n,s){console.error(n,s.componentStack)}render(){return this.state.error===null?this.props.children:this.props.fallback??t.jsx(db,{error:this.state.error,reset:()=>this.setState({error:null})})}}function hI(e,n,s=3){const r=e?e.split(`
627
- `):[],a=n.split(`
628
- `);if(r.length*a.length>25e4)return[...r.map(x=>({kind:"del",text:x})),...a.map(x=>({kind:"add",text:x}))];const o=r.length,c=a.length,u=Array.from({length:o+1},()=>new Array(c+1).fill(0));for(let x=o-1;x>=0;x--)for(let k=c-1;k>=0;k--)u[x][k]=r[x]===a[k]?u[x+1][k+1]+1:Math.max(u[x+1][k],u[x][k+1]);const d=[];let p=0,f=0;for(;p<o&&f<c;)r[p]===a[f]?(d.push({kind:"same",text:r[p]}),p++,f++):u[p+1][f]>=u[p][f+1]?d.push({kind:"del",text:r[p++]}):d.push({kind:"add",text:a[f++]});for(;p<o;)d.push({kind:"del",text:r[p++]});for(;f<c;)d.push({kind:"add",text:a[f++]});const m=d.map((x,k)=>x.kind!=="same"||d.slice(Math.max(0,k-s),k+s+1).some(v=>v.kind!=="same")),y=[];return d.forEach((x,k)=>{m[k]?y.push(x):y.at(-1)?.kind!=="gap"&&y.push({kind:"gap",text:""})}),y}function pI({t:e,onTab:n}){const[s,r]=$.useState("happened"),[a,o]=$.useState(null),c=ib(e),u=c.data?.steps??[];return t.jsxs("div",{className:"db",children:[t.jsxs("div",{className:"convbar",children:[t.jsxs("div",{className:"seg",role:"group","aria-label":"View",children:[t.jsx("button",{className:s==="happened"?"on":"","aria-pressed":s==="happened",onClick:()=>r("happened"),children:"What happened"}),t.jsx("button",{className:s==="log"?"on":"","aria-pressed":s==="log",onClick:()=>r("log"),children:"Full log"})]}),t.jsx("span",{className:"grow"}),s==="happened"&&u.length>0&&t.jsxs("span",{className:"note convcount",children:[u.length," ",u.length===1?"step":"steps",c.data.seconds>=1?` · ${Cu(c.data.seconds)} in all`:""]})]}),s==="happened"?t.jsx(wR,{t:e,onTab:n,onLog:d=>{o(d),r("log")}}):t.jsx(fI,{t:e,chosenKey:a,setKey:o})]})}function fI({t:e,chosenKey:n,setKey:s}){const a=Pe({queryKey:["conversations",e.id],queryFn:()=>Ee(`/api/v1/tickets/${e.id}/conversations`),refetchInterval:3e3}).data??[],o=n??a.filter(m=>m.started).at(-1)?.key??null,c=Pe({queryKey:["conversation",e.id,o],queryFn:()=>Ee(`/api/v1/tickets/${e.id}/conversations/${o}`),enabled:!!o,refetchInterval:e.live?2e3:1e4}),u=$.useMemo(()=>jj(c.data?.updates??[]),[c.data]),[d,p]=$.useState(!0),f=$.useRef(null);return $.useEffect(()=>{d&&f.current?.scrollIntoView({block:"end"})},[u.length,d,o]),a.length?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"pills",style:{marginBottom:6},children:[a.map(m=>t.jsx("button",{className:`btn sm ${m.key===o?"pri":""}`,disabled:!m.started,onClick:()=>s(m.key),children:m.label},m.key)),t.jsx("span",{className:"grow"}),t.jsxs("label",{className:"note",style:{display:"inline-flex",alignItems:"center",gap:6,fontSize:12.5},children:[t.jsx("input",{type:"checkbox",checked:d,onChange:m=>p(m.target.checked)})," Follow live"]})]}),t.jsxs("p",{className:"note",style:{fontSize:12.5,margin:"0 0 14px"},children:["Everything the ",a.find(m=>m.key===o)?.label??"agent"," did, step by step. Read only."," ",c.data&&c.data.total>(c.data.updates.length??0)?`Showing the latest ${c.data.updates.length} of ${c.data.total} entries.`:""]}),t.jsxs("div",{className:"conv",children:[u.map((m,y)=>t.jsx(gI,{it:m,ticket:e.id,cwd:c.data?.cwd},m.kind==="tool"?m.id:y)),t.jsx("div",{ref:f})]}),o&&t.jsxs("div",{className:"convactions",children:[t.jsx(mI,{t:e,to:Gy[o]??"builder"}),!e.chat?.open&&!e.takenOver&&t.jsx(Zr,{t:e,agent:Gy[o]??"builder"})]}),c.data?.command&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"lbl",children:["Open it in ",c.data.tool??"a terminal"]}),t.jsx(se,{text:c.data.command}),t.jsx("p",{className:"note",style:{fontSize:12.5,marginTop:6},children:o==="build"&&um(e)?t.jsxs(t.Fragment,{children:["To work in it yourself, press ",t.jsx("b",{children:"Take over"})," first, so you and the squad never edit at the same time."," ",t.jsx(dm,{t:e})]}):e.takenOver?"The ticket is yours: type into it freely, then press Give back on the Now tab.":"Read it any time. To work in it, take the ticket over while it is being built."})]})]}):t.jsx("p",{className:"note",children:"No conversation yet. It starts when the Analyst reads the ticket."})}const Gy={intake:"analyst",build:"builder",review:"reviewer",tester:"tester"},Zy={analyst:"Analyst",architect:"Architect",builder:"Builder",reviewer:"Reviewer",tester:"Tester"};function mI({t:e,to:n}){const s=pe(),[r,a]=we(e.id,`message-${n}`,"");if(e.stage==="done")return null;const o=()=>s.mutate({path:`/api/v1/tickets/${e.id}/notes`,body:{text:r,to:n},done:`Sent. ${e.now?.noteWhen??`The ${Zy[n]} reads it at its next step.`}`},{onSuccess:()=>a("")});return t.jsxs("div",{className:"msgagent",children:[t.jsx("input",{className:"input",value:r,onChange:c=>a(c.target.value),placeholder:`Message the ${Zy[n]}…`,onKeyDown:c=>c.key==="Enter"&&r.trim()&&o()}),t.jsxs("button",{className:"btn sm pri",disabled:!r.trim()||s.isPending,onClick:o,children:[t.jsx(hs,{size:13})," Send"]})]})}function gI({it:e,ticket:n,cwd:s}){if(e.kind==="plan")return t.jsx(NI,{entries:e.entries});if(e.kind==="tool")return t.jsx(kI,{it:e,ticket:n,cwd:s});const{from:r,content:a}=e;return r==="agent"?t.jsx("div",{className:"conv-text",children:t.jsx(Sm,{content:a,ticket:n})}):t.jsx(xI,{from:r,content:a,ticket:n})}function xI({from:e,content:n,ticket:s}){const r=n.type==="text"?n.text:"",a=r.length>420||r.split(`
629
- `).length>8,[o,c]=$.useState(!a&&e!=="thought"),u=e==="squad-kit"?"squad-kit asked":e==="claude-code"?"Note from Claude Code":"Thinking";return t.jsxs("div",{className:e==="thought"?"conv-thought":"conv-prompt",children:[t.jsxs("button",{className:"conv-who linkish",onClick:()=>c(!o),children:[e==="thought"&&t.jsx(ok,{size:12})," ",u," ",!o&&t.jsx("span",{className:"note",children:"· show"})]}),o&&(e==="thought"?t.jsx("div",{style:{whiteSpace:"pre-wrap"},children:r}):t.jsx(Sm,{content:n,ticket:s}))]})}const yI={read:mk,edit:Lc,delete:Xe,move:Lc,search:Ui,execute:_c,think:ok,fetch:F6,switch_mode:Pp,other:Pp};function kI({it:e,ticket:n,cwd:s}){const r=e.content.some(f=>f.type==="content"&&(f.content.type==="image"||f.content.type==="resource_link")),a=e.content.some(f=>f.type==="diff"),o=e.status==="failed"&&!e.skipped,[c,u]=$.useState(!e.skipped&&(a||r||o));$.useEffect(()=>{(o||r)&&u(!0)},[o,r]);const d=e.answer?hs:e.skipped?Eo:yI[e.toolKind]??Pp,p=e.content.length>0||e.command||e.skipped;return t.jsxs("div",{className:`conv-tool ${e.skipped?"skipped":e.status}`,children:[t.jsxs("button",{className:"conv-tool-head",onClick:()=>p&&u(!c),"aria-expanded":c,children:[t.jsx(d,{size:14}),t.jsx("span",{className:"mono conv-tool-title",children:s?e.title.split(`${s}/`).join(""):e.title}),t.jsx("span",{className:"conv-at",children:e.at?Rn(e.at):""}),t.jsx(jI,{status:e.status,skipped:e.skipped})]}),e.blocked?.map(f=>t.jsx(vI,{line:f},f)),c&&p&&t.jsxs("div",{className:"conv-tool-body",children:[e.skipped&&t.jsx("p",{className:"note",children:"By design, nothing went wrong: squad-kit lets each step do only what it needs, and this was not part of it."}),e.command&&e.toolKind==="execute"?t.jsxs("pre",{className:"conv-cmd",children:["$ ",e.command]}):e.skipped&&e.detail&&t.jsx("pre",{className:"conv-cmd",children:e.detail}),e.content.map((f,m)=>t.jsx(bI,{c:f,ticket:n,cwd:s},m))]})]})}function vI({line:e}){const n=e.endsWith("Allow it in Settings.");return t.jsxs("p",{className:"conv-blocked",children:[t.jsx(jk,{size:13,"aria-hidden":"true"}),t.jsxs("span",{children:[n?e.slice(0,-9):e,n&&t.jsxs(t.Fragment,{children:[t.jsx(Te,{to:"/settings",children:"Settings"}),"."]})]})]})}function jI({status:e,skipped:n}){return n?t.jsxs("span",{className:"conv-status skip",children:[t.jsx(Eo,{size:12})," Skipped"]}):e==="completed"?t.jsxs("span",{className:"conv-status ok",children:[t.jsx(xe,{size:12})," Done"]}):e==="failed"?t.jsxs("span",{className:"conv-status bad",children:[t.jsx(Xe,{size:12})," Failed"]}):t.jsxs("span",{className:"conv-status run",children:[t.jsx(jn,{size:12,className:"spin"})," Running"]})}function bI({c:e,ticket:n,cwd:s}){if(e.type==="diff"){const r=s&&e.path.startsWith(`${s}/`)?e.path.slice(s.length+1):e.path;return t.jsx(wI,{path:r,oldText:e.oldText??"",newText:e.newText,isNew:e.oldText==null})}return e.type==="terminal"?t.jsxs("p",{className:"note",children:["Terminal ",e.terminalId]}):e.content.type==="text"?e.content.text.trimStart().startsWith("```")?t.jsx(pb,{text:e.content.text}):t.jsx(hb,{text:e.content.text}):t.jsx(Sm,{content:e.content,ticket:n})}function hb({text:e}){const n=e.length>600||e.split(`
630
- `).length>12,[s,r]=$.useState(!n);return t.jsxs("div",{className:"conv-out",children:[t.jsx("pre",{children:s?e:`${e.split(`
631
- `).slice(0,10).join(`
632
- `).slice(0,600)}…`}),n&&t.jsx("button",{className:"linkbtn",onClick:()=>r(!s),children:s?"Show less":"Show all output"})]})}function wI({path:e,oldText:n,newText:s,isNew:r}){const a=$.useMemo(()=>hI(n,s),[n,s]),o=a.filter(f=>f.kind==="add").length,c=a.filter(f=>f.kind==="del").length,[u,d]=$.useState(a.length<=40),p=u?a:a.slice(0,40);return t.jsxs("div",{className:"conv-diff",children:[t.jsxs("div",{className:"conv-diff-head mono",children:[t.jsx("span",{style:{overflowWrap:"anywhere"},children:e}),t.jsx("span",{className:"grow"}),r?t.jsxs("span",{className:"add",children:["new file · ",o," lines"]}):t.jsxs("span",{children:[t.jsxs("span",{className:"add",children:["+",o]})," ",t.jsxs("span",{className:"del",children:["−",c]})]})]}),t.jsx("pre",{children:p.map((f,m)=>f.kind==="gap"?t.jsx("div",{className:"gap",children:"⋯"},m):t.jsxs("div",{className:f.kind,children:[t.jsx("span",{className:"sign",children:f.kind==="add"?"+":f.kind==="del"?"−":" "}),f.text||" "]},m))}),a.length>40&&t.jsx("button",{className:"linkbtn",style:{margin:"0 10px 8px"},onClick:()=>d(!u),children:u?"Show less":`Show all ${a.length} lines`})]})}function NI({entries:e}){const n=e.filter(s=>s.status==="completed").length;return t.jsxs("div",{className:"conv-plan",children:[t.jsxs("div",{className:"conv-who",children:[t.jsx(B6,{size:13})," Plan · ",n," of ",e.length," done"]}),e.map((s,r)=>t.jsxs("div",{className:`conv-plan-row ${s.status}`,children:[t.jsx("span",{className:"box",children:s.status==="completed"?t.jsx(xe,{size:11}):s.status==="in_progress"?t.jsx(jn,{size:11,className:"spin"}):null}),s.content]},r))]})}function Sm({content:e,ticket:n}){switch(e.type){case"text":return t.jsx(pb,{text:e.text});case"image":return t.jsx(rm,{className:"conv-img",src:`data:${e.mimeType};base64,${e.data}`,alt:"Picture the agent looked at"});case"audio":return t.jsx("audio",{controls:!0,src:`data:${e.mimeType};base64,${e.data}`});case"resource_link":return t.jsx(Xy,{uri:e.uri,name:e.name,mime:e.mimeType??"",size:e.size??void 0,ticket:n});case"resource":return e.resource.text?t.jsx(hb,{text:e.resource.text}):t.jsx(Xy,{uri:e.resource.uri,name:e.resource.uri.split("/").pop()??"file",mime:e.resource.mimeType??"",ticket:n})}}function Xy({uri:e,name:n,mime:s,size:r,ticket:a}){const o=yn(a,e);return s.startsWith("image/")&&s!=="image/svg+xml"?t.jsxs("div",{className:"conv-media",children:[t.jsx(rm,{className:"conv-img",src:o,alt:n}),t.jsx("span",{className:"note mono",children:n})]}):s.startsWith("video/")?t.jsxs("div",{className:"conv-media",children:[t.jsx("video",{className:"conv-img",src:o,controls:!0,preload:"metadata"}),t.jsx("span",{className:"note mono",children:n})]}):s.startsWith("audio/")?t.jsx("audio",{controls:!0,src:o}):t.jsxs("a",{href:o,target:"_blank",rel:"noreferrer",className:"conv-file",children:[t.jsx(ls,{size:15}),t.jsx("span",{className:"mono",children:n}),t.jsx("span",{className:"note",children:[s.split("/").pop(),r?`${Math.max(1,Math.round(r/1024))} KB`:""].filter(Boolean).join(" · ")})]})}function pb({text:e}){const{theme:n}=qe();return t.jsx("div",{className:"md",children:t.jsx(Zf,{remarkPlugins:[nm],components:{a:({href:s,children:r})=>t.jsx("a",{href:s,target:"_blank",rel:"noreferrer",children:r}),code:({className:s,children:r})=>{const a=/language-(\w+)/.exec(s??"")?.[1],o=String(r).replace(/\n$/,"");return!a&&!o.includes(`
633
- `)?t.jsx("code",{className:"mono",children:r}):t.jsxs("div",{className:"md-code",children:[a&&t.jsx("span",{className:"md-lang",children:a==="mermaid"?"Diagram (Mermaid)":a}),t.jsx(pj,{code:o,language:a??"text",theme:n==="dark"?fo.vsDark:fo.github,children:({tokens:c,getLineProps:u,getTokenProps:d})=>t.jsx("pre",{children:c.map((p,f)=>t.jsx("div",{...u({line:p}),children:p.map((m,y)=>t.jsx("span",{...d({token:m})},y))},f))})})]})}},children:e})})}const SI=(e,n)=>e.part===n.part&&(e.index??0)===(n.index??0);function dc({review:e,at:n,children:s}){const[r,a]=we(e?.t.id??"none",`comment-${n.part}-${n.index??0}`,""),[o,c]=$.useState(r?"comment":null);if(!e)return t.jsx(t.Fragment,{children:s});const u=e.comments.map((p,f)=>({c:p,i:f})).filter(({c:p})=>SI(p,n)),d=()=>{r.trim()&&e.add({...n,text:r.trim()}),a(""),c(null)};return t.jsxs("div",{className:`part ${o?"open":""}`,children:[t.jsxs("div",{className:"partbody",children:[t.jsx("div",{className:"partmain",children:o==="edit"?t.jsx(CI,{review:e,at:n,onDone:()=>c(null)}):s}),o!=="edit"&&t.jsxs("span",{className:"parttools",children:[t.jsx("button",{className:"iconbtn",title:"Comment on this","aria-label":"Comment on this",onClick:()=>c("comment"),children:t.jsx(hx,{size:13})}),e.canEdit(n)&&t.jsx("button",{className:"iconbtn",title:"Edit it yourself","aria-label":"Edit it yourself",onClick:()=>c("edit"),children:t.jsx(Lc,{size:13})})]})]}),u.map(({c:p,i:f})=>t.jsxs("div",{className:"pcomment",children:[t.jsx(hx,{size:12})," ",t.jsx("span",{children:p.text}),t.jsx("button",{className:"iconbtn","aria-label":"Remove comment",onClick:()=>e.remove(f),children:t.jsx(Xe,{size:12})})]},f)),o==="comment"&&t.jsxs("div",{className:"pcomment new",children:[t.jsx("input",{className:"input",autoFocus:!0,value:r,placeholder:"Your comment on this part. Enter to add",onChange:p=>a(p.target.value),onKeyDown:p=>{p.key==="Enter"&&d(),p.key==="Escape"&&c(null)}}),t.jsx("button",{className:"btn sm",onClick:d,children:"Add"})]})]})}function CI({review:e,at:n,onDone:s}){const r=pe(),a=e.t,o=n.index??0,[c,u]=we(a.id,`edit-${n.part}-${o}`,n.part==="story"?a.story??"":n.part==="step"?a.steps?.[o]?.title??"":""),[d,p]=we(a.id,`edit-criterion-${o}`,a.criteria?.[o]??{given:"",when:"",then:""}),f=()=>r.mutate({path:`/api/v1/tickets/${a.id}/plan/edit`,body:n.part==="criterion"?{...n,criterion:d}:{...n,text:c},done:"Edited. Your wording stays."},{onSuccess:()=>{xo(go(gt,a.id,`edit-${n.part}-${o}`)),xo(go(gt,a.id,`edit-criterion-${o}`)),s()}});return t.jsxs("div",{className:"editpart",children:[n.part==="criterion"?["given","when","then"].map(m=>t.jsxs("label",{children:[t.jsx("em",{children:m[0].toUpperCase()+m.slice(1)}),t.jsx("input",{className:"input",value:d[m],onChange:y=>p({...d,[m]:y.target.value})})]},m)):t.jsx("textarea",{className:"waynote",rows:n.part==="story"?3:2,autoFocus:!0,value:c,onChange:m=>u(m.target.value)}),t.jsxs("div",{className:"editbtns",children:[t.jsx("button",{className:"btn sm pri",disabled:r.isPending,onClick:f,children:"Save"}),t.jsx("button",{className:"btn sm",onClick:s,children:"Cancel"})]})]})}const Jy=e=>e?`Given ${e.given}, when ${e.when}, then ${e.then}.`:"";function $I({t:e}){const[n,s]=$.useState(!0),r=e.planReview?.before;if(!r)return null;const a=[],o=(d,p="",f="")=>p!==f&&a.push({label:d,old:p,now:f});o("The story",r.story,e.story);const c=Math.max(r.criteria?.length??0,e.criteria?.length??0);for(let d=0;d<c;d++)o(`Done when ${d+1}`,Jy(r.criteria?.[d]),Jy(e.criteria?.[d]));(r.decision!==void 0||e.decision)&&o("The decision",r.decision,e.decision?`${e.decision.title}: ${e.decision.options.find(d=>d.chosen)?.name??""}`:"");const u=Math.max(r.steps?.length??0,e.steps?.length??0);for(let d=0;d<u;d++)o(`Step ${d+1}`,r.steps?.[d],e.steps?.[d]?.title);return t.jsxs("div",{className:"changed",children:[t.jsxs("button",{className:"changedhead",onClick:()=>s(!n),children:[t.jsx("b",{children:"What changed"})," ",a.length?`${a.length} ${a.length===1?"part":"parts"}`:"nothing"," since the last version ",n?"▾":"▸"]}),n&&t.jsxs(t.Fragment,{children:[(e.planReview?.sent??[]).length>0&&t.jsxs("div",{className:"sentlist",children:["Your comments:"," ",e.planReview.sent.map((d,p)=>t.jsxs("span",{children:["“",d.text,"”"]},p))]}),a.map(d=>t.jsxs("div",{className:"chrow",children:[t.jsx("div",{className:"chlabel",children:d.label}),t.jsx("div",{className:d.old?"chold":"chold empty",children:d.old||t.jsx("i",{children:"new"})}),t.jsx("div",{className:"chnew",children:d.now||t.jsx("i",{children:"removed"})})]},d.label))]})]})}function fb(e){return!!(e.now&&(e.now.state==="working"||e.now.state==="queued"||e.now.state==="stopping"))}function EI(e){const n=Math.max(0,Math.floor((Date.now()-Date.parse(e))/1e3));if(n<2)return"just now";if(n<60)return`${n} seconds ago`;const s=Math.floor(n/60);return`${s} minute${s===1?"":"s"} ago`}function mb({bar:e,big:n}){return e?.length?t.jsx("div",{className:`segbar ${n?"big":""}`,"aria-hidden":!0,children:e.map((s,r)=>t.jsx("span",{className:s==="done"?"d":s==="now"?"n":""},r))}):null}function TI({t:e}){const n=e.now;if(n.state==="queued")return t.jsx("div",{className:"nl1 quiet",children:n.line});const[s,...r]=n.line.split(" · "),a=e.quiet;return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"nl1",children:[t.jsx("span",{className:"live"}),t.jsxs("span",{children:[t.jsx("b",{children:s}),r.length?` · ${r.join(" · ")}`:""]})]}),a?t.jsxs("div",{className:`nl2 slow ${a.kind}`,children:[a.kind==="stuck"?t.jsx(dr,{size:12}):t.jsx(uk,{size:12}),a.kind==="stuck"?"Looks stuck":"Taking longer than usual",n.seconds!==void 0&&a.kind==="long"?` · ${n.time?.split(" · ")[0]}`:""]}):n.time&&t.jsx("div",{className:"nl2",children:n.time}),t.jsx(mb,{bar:n.bar})]})}function gb({t:e}){const n=e.now,s=n.state==="queued"?"Next in line":n.state==="stopping"?"Stopping":"Working",[r,...a]=(n.detail??"").split(" · ");return t.jsxs("section",{className:"nowcard","aria-label":"What is happening now",children:[t.jsxs("div",{className:"nowhead",children:[n.state==="working"&&t.jsx("span",{className:"live"}),t.jsxs("span",{children:[s,n.state==="working"&&n.lastAt?` · last update ${EI(n.lastAt)}`:""]})]}),t.jsx("p",{className:"nowsay",children:n.sentence}),n.detail&&t.jsxs("div",{className:"nowmeta",children:[n.part?t.jsx("b",{children:r}):r,a.length?` · ${a.join(" · ")}`:""]}),t.jsx(mb,{bar:n.bar,big:!0}),n.next&&t.jsxs("div",{className:"nownext",children:[t.jsx("b",{children:"What comes next:"})," ",n.next]})]})}function xb({t:e}){const n=e.now?.role==="squad"?"tester":e.now?.role,s=n?e.activity.filter(o=>o.who===n):[],r=(s.length>=2?s:e.activity).slice(0,6);if(!r.length)return null;const a=s.length>=2&&n?$s[n]:"squad";return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"lbl",children:["What the ",a," did, in plain words"]}),t.jsx("div",{className:"feed",children:r.map((o,c)=>t.jsxs("div",{className:"fe",children:[t.jsx("span",{className:"tm",children:Rn(o.at)}),t.jsx(Hr,{role:o.who,small:!0}),t.jsx("span",{children:o.text})]},o.at+c))})]})}function AI({t:e}){const n=pe(),[s,r]=$.useState(!1),a=e.now?.slow,o=n.isPending||e.stopRequested;if(!a)return null;const c=a.kind==="stuck",u=()=>n.mutate({path:`/api/v1/tickets/${e.id}/keep-waiting`,body:{minutes:10},done:"OK. squad-kit stays quiet about it for 10 minutes."}),d=()=>n.mutate({path:`/api/v1/tickets/${e.id}/restart`,done:"Stopping the step. It starts again at once, with the work so far."}),p=()=>n.mutate({path:`/api/v1/tickets/${e.id}/stop`,done:"Stopping. The work so far is kept."}),f=()=>n.mutate({path:`/api/v1/tickets/${e.id}/unstick`,done:"Ended the stuck command. The squad carries on."}),m=()=>n.mutate({path:`/api/v1/tickets/${e.id}/free-port`,done:"Stopped it. The step starts again, with the work so far."},{onSettled:()=>r(!1)});return t.jsxs("section",{className:`slowcard ${c?"stuck":""}`,"aria-label":a.title,children:[t.jsxs("div",{className:"slowhead",children:[c?t.jsx(dr,{size:17}):t.jsx(uk,{size:17}),t.jsx("b",{children:a.title}),t.jsx("span",{className:"grow"}),t.jsx("span",{className:"where",children:a.where})]}),t.jsxs("div",{className:"slowbody",children:[t.jsx("p",{className:"slowsay",children:a.text}),t.jsx("div",{className:"facts",children:a.facts.map(y=>t.jsxs("div",{className:"fact",children:[t.jsx("span",{children:y.label}),t.jsx("span",{children:y.value})]},y.label))}),t.jsxs("div",{className:"ways",children:[a.freePort&&t.jsx("button",{className:"btn pri",disabled:o,onClick:()=>r(!0),children:"Stop it and try again"}),c&&a.canEnd&&!a.freePort&&t.jsx("button",{className:"btn pri",disabled:o,onClick:f,children:"End the stuck command"}),!c&&t.jsx("button",{className:"btn you",disabled:o,onClick:u,children:"Give it 10 more minutes"}),t.jsx("button",{className:"btn",disabled:o,onClick:d,children:"Stop and try again"}),c&&t.jsx("button",{className:"btn",disabled:o,onClick:u,children:"Keep waiting"}),t.jsxs("button",{className:"btn",disabled:o,onClick:p,children:[t.jsx(us,{size:12})," Stop"]})]}),c&&a.canEnd&&t.jsx("p",{className:"note slownote",children:"Ending the command gives the squad an error back, and it carries on in the same conversation."}),a.detail&&t.jsxs("details",{className:"costdetails slownote",children:[t.jsx("summary",{children:"Details for engineers"}),t.jsx("p",{className:"note",style:{whiteSpace:"pre-line",overflowWrap:"anywhere"},children:a.detail})]}),t.jsxs("div",{className:"slowfoot",children:[t.jsx("span",{children:a.limit??"Nothing is lost whatever you choose."}),t.jsx("span",{className:"grow"}),t.jsx(se,{text:a.freePort?`squad unstick ${e.id} --free-port`:c&&a.canEnd?`squad unstick ${e.id}`:`squad wait ${e.id} --more 10m`})]})]}),s&&a.freePort&&t.jsxs(Ve,{title:"Stop it and try again?",onClose:()=>r(!1),footer:t.jsxs(t.Fragment,{children:[t.jsx("button",{className:"btn pri",disabled:n.isPending,onClick:m,children:n.isPending?"Stopping it…":"Stop it and try again"}),t.jsx("button",{className:"btn",onClick:()=>r(!1),children:"Cancel"}),t.jsx("span",{className:"grow"}),t.jsx(se,{text:`squad unstick ${e.id} --free-port`})]}),children:[t.jsxs("p",{children:["squad-kit stops ",a.freePort.what,", then starts this step again."," ",a.freePort.what.startsWith("your app")?"You can start it again from Your apps afterwards.":"squad-kit started that program itself, so nothing of yours is closed."]}),t.jsx("p",{className:"note",children:"The work so far is kept. squad-kit checks again that it started the program before it stops it."})]})]})}function yb({t:e}){const[n,s]=we(e.id,"status-ask",""),[r,a]=$.useState([]),[o,c]=$.useState(!1),u=async()=>{const p=n.trim();if(!(!p||o)){c(!0);try{const f=await bt(`/api/v1/tickets/${e.id}/status/ask`,"POST",{text:p});a(m=>[...m,{q:p,a:f,at:new Date().toISOString()}]),s("")}catch(f){a(m=>[...m,{q:p,error:f instanceof Error?f.message:String(f),at:new Date().toISOString()}])}finally{c(!1)}}},d=In(n).dir;return t.jsxs("section",{className:"askbox","aria-label":"Ask about this ticket",children:[t.jsx("label",{htmlFor:`ask-${e.id}`,className:"lbl",children:"Ask about this ticket"}),r.length>0&&t.jsx("div",{className:"askthread",children:r.map((p,f)=>t.jsx(PI,{t:e,said:p},p.at+f))}),t.jsxs("div",{className:"askrow",children:[t.jsx("input",{id:`ask-${e.id}`,className:"input",dir:d,value:n,onChange:p=>s(p.target.value),onKeyDown:p=>p.key==="Enter"&&void u(),placeholder:"For example: is there a problem? when will it be ready?"}),t.jsxs("button",{className:"btn pri",disabled:!n.trim()||o,onClick:()=>void u(),children:[t.jsx(hs,{size:14})," Ask"]})]}),t.jsxs("div",{className:"askfoot",children:[t.jsx("span",{children:"Status answers come at once, in English or Arabic, with no AI cost. Questions for an agent reach it at its next safe moment."}),t.jsx("span",{className:"grow"}),t.jsx(se,{text:`squad status ${e.id}`})]})]})}function PI({t:e,said:n}){const s=n.a,r=s?.lang==="ar",a=In(n.q).dir;return t.jsxs("div",{className:"askturn",children:[t.jsx("div",{className:"askme",dir:a,children:n.q}),t.jsxs("div",{className:`askit ${r?"ar":""}`,dir:r?"rtl":"ltr",lang:r?"ar":"en",children:[t.jsxs("div",{className:"who",children:[t.jsx("b",{children:"squad-kit"}),s?.instant&&t.jsx("span",{className:"tag",children:r?"إجابة فورية":"answered at once"}),t.jsx("span",{className:"note",children:Rn(n.at)})]}),n.error?t.jsx("p",{className:"err",children:n.error}):s?.lines.map((o,c)=>t.jsx("p",{children:o},c)),s&&s.offers.length>0&&t.jsx("div",{className:"askoffers",children:s.offers.map(o=>t.jsx(RI,{t:e,o,question:n.q},o.do+o.label))})]})]})}function RI({t:e,o:n,question:s}){const r=pe(),{toast:a}=qe(),[o,c]=$.useState(!1),[u,d]=$.useState(!1);switch(n.do){case"propose":return t.jsxs(t.Fragment,{children:[t.jsxs("button",{className:"btn sm offer",onClick:()=>c(!0),children:[t.jsxs("span",{className:"ol",children:[t.jsx(cs,{size:13})," ",n.label]}),t.jsx("span",{className:"on",children:n.note})]}),o&&t.jsx(Bo,{t:e,initial:s,onClose:()=>c(!1)})]});case"note":return t.jsxs("button",{className:"btn sm offer",disabled:u||r.isPending,onClick:()=>r.mutate({path:`/api/v1/tickets/${e.id}/notes`,body:{text:s,...n.to?{to:n.to}:{}}},{onSuccess:()=>{d(!0),a(`Sent. ${n.note}`)}}),children:[t.jsxs("span",{className:"ol",children:[t.jsx(hs,{size:13})," ",u?"Sent":n.label]}),t.jsx("span",{className:"on",children:n.note})]});case"chat":return t.jsx(Zr,{t:e,agent:n.to,label:n.label});case"stop":return t.jsxs("button",{className:"btn sm",disabled:r.isPending||e.stopRequested,onClick:()=>r.mutate({path:`/api/v1/tickets/${e.id}/stop`,done:"Stopping. The work so far is kept."}),children:[t.jsx(us,{size:12})," ",n.label]})}}function II({t:e}){const n=pe(),[s,r]=$.useState(!1),a=e.agentQuestion,o=a.port,c=a.options.find(p=>p==="Stop it"),u=a.options.find(p=>p!=="Stop it"),d=(p,f)=>n.mutate({path:`/api/v1/tickets/${e.id}/reply`,body:{text:p},done:f},{onSettled:()=>r(!1)});return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"db",children:[t.jsxs("div",{className:"youbox",children:[t.jsx("span",{className:"ring",children:"?"}),t.jsxs("div",{children:[t.jsx("b",{children:"Another program is in the way"}),t.jsx("span",{children:"You decide. Nothing is stopped unless you press Stop it."})]})]}),t.jsx("div",{className:"lbl",children:"What is in the way"}),t.jsx("p",{className:"stuckq",children:a.text}),a.why&&t.jsx("p",{className:"note",children:a.why}),t.jsxs("details",{className:"costdetails",children:[t.jsx("summary",{children:"Details for engineers"}),t.jsxs("p",{className:"note",children:[o.program||"A program",o.pid?` (process ${o.pid})`:", which the system does not name,",o.port?` listens on port ${o.port}`:"",o.app?`: your app ${o.app}, which squad-kit runs from Your apps`:"","."]}),t.jsxs("p",{className:"note",children:["The Builder asked: “",o.asked,"”"]})]})]}),t.jsxs("div",{className:"df",children:[c&&t.jsx("button",{className:"btn pri",disabled:n.isPending,onClick:()=>r(!0),children:c}),u&&t.jsx("button",{className:`btn ${c?"":"pri"}`,disabled:n.isPending,onClick:()=>d(u,"Sent. The Builder carries on without it."),children:u}),t.jsx("span",{className:"grow"}),t.jsx(se,{text:`squad reply ${e.id} ${Le(c??u??"")}`})]}),s&&c&&t.jsxs(Ve,{title:o.app?`Stop your app ${o.app}?`:"Stop that program?",onClose:()=>r(!1),footer:t.jsxs(t.Fragment,{children:[t.jsx("button",{className:"btn pri",disabled:n.isPending,onClick:()=>d(c,"Stopping it. The Builder carries on."),children:n.isPending?"Stopping it…":"Stop it"}),t.jsx("button",{className:"btn",onClick:()=>r(!1),children:"Cancel"}),t.jsx("span",{className:"grow"}),t.jsx(se,{text:`squad reply ${e.id} ${Le(c)}`})]}),children:[t.jsxs("p",{children:["squad-kit stops ",o.app?`your app ${o.app}`:"that program",", then the Builder carries on. ",o.app?"You can start it again from Your apps afterwards.":"Anything not saved in that program is lost."]}),t.jsx("p",{className:"note",children:"squad-kit checks again first that it is still the same program."})]})]})}function kb({t:e,banner:n}){const s=pe(),r=e.testChange;if(!r?.ask)return null;const a=c=>s.mutate({path:`/api/v1/tickets/${e.id}/test-command`,body:{use:c},done:c?"squad-kit tests this project the new way from now on.":"squad-kit keeps the current way of testing."}),o=t.jsxs("div",{className:"outdated-item testchange",children:[t.jsxs("div",{className:"outdated-head",children:[t.jsx("span",{className:"ic",children:t.jsx(P6,{size:15})}),t.jsx("b",{children:"The way this project's tests run changed, and squad-kit cannot tell if the new way checks as much as the current one."})]}),t.jsxs("div",{className:"row",children:[t.jsx("button",{className:"btn sm pri",disabled:s.isPending,title:"The checks stay as they are, and the Builder fixes what they find.",onClick:()=>a(!1),children:"Keep the current way"}),t.jsx("button",{className:"btn sm",disabled:s.isPending,title:"The checks use the new way from now on.",onClick:()=>a(!0),children:"Use the new way"}),t.jsx("span",{className:"grow"}),t.jsx(se,{text:`squad test-command ${e.id} --keep`})]}),t.jsxs("details",{className:"costdetails",children:[t.jsx("summary",{children:"Details for engineers"}),t.jsxs("p",{className:"note",children:["Current: ",t.jsx("code",{children:r.from}),t.jsx("br",{}),"New: ",t.jsx("code",{children:r.to}),r.ran?t.jsxs(t.Fragment,{children:[t.jsx("br",{}),r.ran]}):null]})]})]});return n?t.jsx("div",{className:"outdated","aria-label":"A choice about the tests",children:o}):o}const Cm="No tests ran, so squad-kit could not check that the work does what it should. Check the proof with extra care. To turn tests on, have an engineer add tests to the project.";function vb(e){return e?.checks==="unchecked"?"Not checked: no tests ran":e?.checks==="skipped"?/weakened/i.test(e.checksText??"")?"Tests weakened, you continued":"Checks failed, you continued":e?.checksText??"All checks pass"}function zI(e){if(e?.checks!=="unchecked")return null;const n=e.checksText?.split(" · ").slice(1).join(" · ");return Cm.replace("Check the proof",`${n?`Passed: ${n}. `:""}Check the proof`)}function MI(e){const n='Compare the screens before and after each "done when".';return e?.checks==="unchecked"?`Not checked: no tests ran, so look closely. ${n}`:e&&[e.checks,e.review,e.proof].some(s=>s==="skipped")?`You went past a gate, so look closely. ${n}`:`Every gate is green. ${n}`}function jb(e){const n=(e.proof??[]).some(a=>a.shows==="broken"),s=(e.proof??[]).some(a=>a.shows==="not-shown"),r=(e.proof??[]).some(a=>a.shows==="off-screen");return e.gates?.proof==="skipped"?n?'A "done when" not working, you continued':s?'A "done when" not shown, you continued':r?"Not on a screen, you continued":"No screenshots, you continued":e.gates?.proof==="fail"&&n?'A "done when" not working yet':e.gates?.proof==="fail"&&s?'A "done when" not shown yet':e.gates?.proof==="fail"&&r?"Nothing shows on a screen yet":"Proof made"}function bb(e){return e.gates?.proof==="skipped"||(e.work?.screens??0)>0?"No screenshots were taken for this ticket. See the activity for why.":e.gates?.checks==="unchecked"?"No screens change in this ticket and no tests ran, so read the changes in the Changes tab.":"No screens change in this ticket, so the passing checks are the proof."}function FI(e){return e.weakened?.length?"weakened tests":e.gate==="hooks"?"project's own check":e.gate==="checks"?"failed checks":e.gate==="proof"?"unfinished proof":"open review"}function Fr({state:e,text:n}){const s=e==="pass"?"ok":e==="skipped"?"skip":e==="unchecked"?"unchecked":"wait";return t.jsxs("span",{className:`pill ${s}`,title:e==="unchecked"?Cm:void 0,children:[e==="pass"&&t.jsx(xe,{size:13,strokeWidth:2.5}),e==="unchecked"&&t.jsx(zr,{size:13,strokeWidth:2.5}),n]})}function wb({g:e,className:n=""}){const s=zI(e);return s?t.jsxs("p",{className:`note unchecked-why ${n}`,children:[t.jsx(zr,{size:14,strokeWidth:2.4,"aria-hidden":"true"}),t.jsxs("span",{children:[t.jsx("b",{children:"Not checked."})," ",s]})]}):null}function LI(e){return e==="met"?"Met":e==="broken"?"Not working yet":e==="not-shown"?"Not shown yet":e==="off-screen"?"Not on a screen":null}function $m(e){return e==="met"?"met":e==="broken"?"broken":e==="not-shown"?"notshown":e==="off-screen"?"notonscreen":""}function bo(e){return e.shows==="broken"||e.shows==="not-shown"||e.shows==="off-screen"?e.why??e.note??"":e.note??""}function _I(e){const n=(e.proof??[]).filter(s=>s.shows==="off-screen").map(s=>({criterion:s.criterion,why:bo(s)}));return[...n,...(e.offScreen??[]).filter(s=>!n.some(r=>r.criterion===s.criterion))]}function Nb(e,n){const s=[],r=[];for(const a of e)r.push(s.length),s.push({src:n(a.before),caption:`${a.criterion} · ${a.beforeLabel}`},{src:n(a.after),caption:`${a.criterion} · ${a.afterLabel}`}),(a.more??[]).forEach((o,c)=>s.push({src:n(o.after),caption:`${a.criterion} · ${o.note||`Picture ${c+2}`}`}));return{pictures:s,starts:r}}function Sb({shows:e,size:n=15}){return e==="broken"?t.jsx(Xe,{size:n,strokeWidth:2.5,className:"vx","aria-hidden":"true"}):e==="not-shown"?t.jsx(pk,{size:n,strokeWidth:2.25,className:"vq","aria-hidden":"true"}):e==="off-screen"?t.jsx(K6,{size:n,strokeWidth:2.25,className:"vo","aria-hidden":"true"}):t.jsx(xe,{size:n,strokeWidth:2.5,"aria-hidden":"true"})}function of({shows:e}){const n=LI(e);return n?t.jsx("span",{className:`verdict ${$m(e)}`,children:n}):null}function Cb({shot:e,first:n,onOpen:s}){return e.more?.length?t.jsxs("div",{className:"proofmore",children:[t.jsx("small",{children:'More pictures of this "done when"'}),t.jsx("div",{className:"proofmore-row",children:e.more.map((r,a)=>t.jsxs("figure",{children:[t.jsx("button",{className:"zoom",onClick:()=>s(n+a),"aria-label":`Open picture ${a+2} of this "done when" full size`,children:t.jsx("img",{src:Cs(`/api/v1/proof/${r.after}`),alt:`${e.criterion}, ${r.note||`picture ${a+2}`}`,loading:"lazy"})}),t.jsxs("figcaption",{children:[r.note&&t.jsx("span",{children:r.note}),Br(r)&&t.jsx("code",{children:Br(r)})]})]},r.after))})]}):null}function Xi({t:e,className:n}){return e.alsoChanged?.length?t.jsxs("p",{className:`note alsochanged${n?` ${n}`:""}`,children:[t.jsx("b",{children:"Also changed, not in the plan:"})," ",e.alsoChanged.join("; "),"."]}):null}function lf({t:e}){return!e.offScreen?.length||Wo(e)?null:t.jsxs("div",{className:"offscreen",children:[t.jsx("div",{className:"lbl",children:"Not on a screen"}),t.jsx("ul",{children:e.offScreen.map(n=>t.jsxs("li",{children:[t.jsx("b",{children:n.criterion}),t.jsx("span",{children:n.why})]},n.criterion))})]})}function OI({t:e}){const n=_I(e);return n.length?t.jsxs("div",{className:"offscreen",children:[t.jsx("div",{className:"lbl",children:"Not on a screen, so look at these yourself"}),t.jsx("ul",{children:n.map(s=>t.jsxs("li",{children:[t.jsx("b",{children:s.criterion}),t.jsx("span",{children:s.why})]},s.criterion))})]}):null}function qI(e,n){return!!e.mergedAt||e.stage==="done"||n&&e.stage==="release"}function Zc(e){return au.createPortal(e,document.body)}function DI(){const e=Qe();return e.data?.ready?e.data.meta.engine==="demo":!1}function BI({t:e,onDeleted:n,items:s=[]}){const[r,a]=$.useState(!1),[o,c]=$.useState(null),u=qI(e,DI()),d=$b(e),p=$.useRef(null);$.useEffect(()=>{if(!r)return;const m=x=>p.current&&!p.current.contains(x.target)&&a(!1),y=x=>x.key==="Escape"&&a(!1);return document.addEventListener("mousedown",m),document.addEventListener("keydown",y),()=>{document.removeEventListener("mousedown",m),document.removeEventListener("keydown",y)}},[r]);const f=m=>()=>{a(!1),m()};return t.jsxs("span",{className:"more",ref:p,children:[t.jsx("button",{className:"iconbtn","aria-label":"More actions","aria-haspopup":"menu","aria-expanded":r,title:"More actions",onClick:()=>a(!r),children:t.jsx(hk,{size:16})}),r&&t.jsxs("div",{className:"more-menu",role:"menu",children:[s.map(m=>t.jsx("button",{role:"menuitem",onClick:f(m.onPick),children:m.label},m.key)),e.archived?t.jsxs("button",{role:"menuitem",onClick:f(d),children:[t.jsx(ak,{size:15})," Unarchive"]}):u?t.jsxs("button",{role:"menuitem",onClick:f(()=>c("archive")),children:[t.jsx(zc,{size:15})," Archive…"]}):e.ownerDeleted?t.jsxs("button",{role:"menuitem",className:"danger",onClick:f(()=>c("delete")),children:[t.jsx(vn,{size:15})," Remove from my board…"]}):t.jsxs("button",{role:"menuitem",className:"danger",onClick:f(()=>c("delete")),children:[t.jsx(vn,{size:15})," Delete ticket…"]})]}),o==="delete"&&Zc(t.jsx(cf,{t:e,onClose:()=>c(null),onDeleted:n})),o==="archive"&&Zc(t.jsx(WI,{t:e,onClose:()=>c(null)}))]})}function $b(e){const n=pe();return()=>n.mutate({path:`/api/v1/tickets/${e.id}/archive`,body:{undo:!0},done:`${e.id} is back on the board.`})}function Xc({items:e,mark:n}){return t.jsx("ul",{className:"rmlist",children:e.map(s=>t.jsxs("li",{children:[n==="x"?t.jsx(Xe,{size:16,className:"x","aria-hidden":!0}):n==="hide"?t.jsx(pk,{size:16,className:"hide","aria-hidden":!0}):t.jsx(xe,{size:16,className:"ok","aria-hidden":!0}),t.jsx("span",{children:s})]},s))})}function cf({t:e,onClose:n,onDeleted:s}){const r=pe(),{toast:a}=qe(),[o,c]=$.useState(!!e.deleting?.remote),u=Pe({queryKey:["delete-plan",e.id,o],queryFn:()=>Ee(`/api/v1/tickets/${e.id}/delete?remote=${o?1:0}`),placeholderData:n4}),d=u.data,p=!!(d?.local??e.ownerDeleted),f=()=>r.mutate({path:`/api/v1/tickets/${e.id}/delete`,body:{remote:o},done:p?`Removed ${e.id} from your board.`:`Deleted ${e.id}. Its cost stays in Usage.`},{onSuccess:m=>{m.notes.length&&a(`${m.notes.join(". ")}.`),n(),s()},onError:()=>void u.refetch()});return t.jsxs(Ve,{title:p?`Remove ${e.id} from your board?`:`Delete ${e.id}?`,onClose:n,icon:t.jsx("span",{className:"glyph",children:t.jsx(vn,{size:15})}),footer:t.jsxs(t.Fragment,{children:[t.jsxs("button",{className:"btn danger",disabled:!d||!!d.refused||r.isPending,onClick:f,children:[t.jsx(vn,{size:15})," ",p?r.isPending?"Removing…":"Remove from my board":r.isPending?"Stopping the squad and deleting…":d?.unfinished?"Delete again":`Delete ${e.id}`]}),t.jsx("button",{className:"btn",onClick:n,children:"Cancel"}),t.jsx("span",{className:"grow"}),t.jsx(se,{text:d?.command??`squad delete ${e.id}`})]}),children:[t.jsx("p",{children:d?.summary??e.title}),u.isError&&t.jsx("div",{className:"stuckbox",children:u.error.message}),d?.refused&&t.jsx("div",{className:"stuckbox",children:d.refused}),d&&!d.refused&&t.jsxs(t.Fragment,{children:[d.unfinished&&t.jsxs("div",{className:"stuckbox rm-gap",children:["The last delete did not finish: ",d.unfinished,". Delete again to finish it. It goes on where it stopped."]}),d.warnings.length>0&&t.jsx("div",{className:"stuckbox rm-gap",children:d.warnings.map(m=>t.jsx("div",{children:m},m))}),t.jsx("div",{className:"lbl",children:"This removes"}),t.jsx(Xc,{items:d.removes,mark:"x"}),t.jsx("div",{className:"lbl",children:"This stays"}),t.jsx(Xc,{items:d.stays,mark:"ok"}),d.pushed&&t.jsxs("label",{className:"talkfirst",children:[t.jsx("input",{type:"checkbox",checked:o,onChange:m=>c(m.target.checked)}),t.jsxs("span",{children:[t.jsxs("b",{children:["Also delete the branch ",d.pushed.branch," on ",d.pushed.remote,"."]})," ",d.pushed.why]})]}),p?t.jsxs("p",{className:"rm-note",children:["Only ",d.local?.by??"its owner"," could delete ",e.id,". This cleans your computer only."]}):t.jsxs("p",{className:"rm-note",children:["A ticket that is already merged cannot be deleted, because its code is in ",d.base,". Use ",t.jsx("b",{children:"Archive"})," to hide it from the board. Its history stays."]})]})]})}function WI({t:e,onClose:n}){const s=pe(),r=()=>s.mutate({path:`/api/v1/tickets/${e.id}/archive`,done:`Archived ${e.id}. Show archived, at the bottom of the board, shows it again.`},{onSuccess:n});return t.jsxs(Ve,{title:`Archive ${e.id}?`,onClose:n,icon:t.jsx("span",{className:"glyph",children:t.jsx(zc,{size:15})}),footer:t.jsxs(t.Fragment,{children:[t.jsxs("button",{className:"btn pri",disabled:s.isPending,onClick:r,children:[t.jsx(zc,{size:15})," Archive ",e.id]}),t.jsx("button",{className:"btn",onClick:n,children:"Cancel"}),t.jsx("span",{className:"grow"}),t.jsx(se,{text:`squad archive ${e.id}`})]}),children:[t.jsxs("p",{children:[e.title," · ",e.status]}),t.jsx("div",{className:"lbl",children:"This hides"}),t.jsx(Xc,{items:["The ticket from the board. Show archived, at the bottom of the board, shows it again."],mark:"hide"}),t.jsx("div",{className:"lbl",children:"This stays"}),t.jsx(Xc,{items:["Its code, and its history in git and in .squad/",...e.release&&e.stage!=="done"?[`Its place in release ${e.release}`]:[],"The cost it used, still counted in Usage"],mark:"ok"}),t.jsx("p",{className:"rm-note",children:"Unarchive brings it back to the board, as it was."})]})}function UI({t:e,onDeleted:n}){const[s,r]=$.useState(!1),a=$b(e);if(e.ownerDeleted&&!e.deleting){const o=e.ownerDeleted;return t.jsxs("div",{className:"stuckbox rm-banner",children:[t.jsxs("span",{className:"grow",children:[t.jsxs("b",{children:["Deleted by ",o.by,"."]})," ",o.how==="note"?`${o.by} deleted ${e.id} on their computer ${nn(o.at)}.`:`Its branch ${o.branch} is gone from the remote and it never reached the main code, so ${o.by} deleted it.`," ","Only ",o.by," could delete it. Removing it here cleans your computer only."]}),t.jsxs("button",{className:"btn sm",onClick:()=>r(!0),children:[t.jsx(vn,{size:13})," Remove from my board"]}),t.jsx(se,{text:`squad delete ${e.id}`}),s&&Zc(t.jsx(cf,{t:e,onClose:()=>r(!1),onDeleted:n}))]})}if(e.deleting){const o=!!e.deleting.error||Date.now()-Date.parse(e.deleting.at)>9e4;return t.jsxs("div",{className:"stuckbox rm-banner",children:[t.jsxs("span",{className:"grow",children:[t.jsx("b",{children:e.deleting.error?"Delete did not finish.":"Deleting…"})," ",e.deleting.error?`${e.deleting.error}. Delete again to finish it; it goes on where it stopped.`:"The squad stops first, then each part of the ticket goes."]}),o&&t.jsxs("button",{className:"btn sm",onClick:()=>r(!0),children:[t.jsx(vn,{size:13})," Delete again"]}),t.jsx(se,{text:`squad delete ${e.id}`}),s&&Zc(t.jsx(cf,{t:e,onClose:()=>r(!1),onDeleted:n}))]})}return e.archived?t.jsxs("div",{className:"calm rm-banner",children:[t.jsx("span",{className:"ring",children:t.jsx(zc,{size:16})}),t.jsxs("div",{className:"grow",children:[t.jsxs("b",{children:["Archived ",nn(e.archived.at)," by ",e.archived.by]}),t.jsx("span",{children:"It is off the board. Its history stays in git and in .squad/."}),t.jsx("div",{className:"rm-cmd",children:t.jsx(se,{text:`squad archive ${e.id} --undo`})})]}),t.jsxs("button",{className:"btn sm",onClick:a,children:[t.jsx(ak,{size:13})," Unarchive"]})]}):null}function wo(e){return!!e.mergedAt||e.stage==="done"}function Em(e){const n=Qe(),s=n.data?.ready?[...n.data.tickets,...n.data.archived??[]]:[];return(e.dependsOn??[]).map(r=>s.find(a=>a.id===r)).filter(r=>!!r)}function Tm(){const e=Qe();return e.data?.ready&&e.data.meta.git?.base||"main"}function HI(e){return e.waiting?.kind==="depends"||e.dependency?.way==="wait"&&!e.dependency.started&&!e.squad&&!e.waiting}const VI={branch:"--on-branch",anyway:"--anyway",wait:"--wait"};function KI({t:e}){const n=pe(),s=Tm(),r=Qe(),a=r.data?.ready?r.data.meta.engine==="live":!0,o=Em(e).filter(v=>!wo(v)),c=e.dependency?.way==="wait"&&!e.waiting,[u,d]=$.useState(c?null:"branch"),p=o.map(v=>v.id).join(" and ")||"it",f=o.length===1?o[0]:void 0,m=!!(a&&f&&!f.worktree&&!f.branch),y=[{way:"branch",label:f?`Build on ${f.id}'s branch`:"Build on its branch",note:`The copy starts from ${p}'s work so far. Once ${p} is merged, the latest ${s} comes in and any clash is settled.`,off:f?m?`${f.id} has no code yet.`:void 0:"A copy can start from one branch only."},{way:"anyway",label:"Build anyway",note:`From ${s}, without ${p}. This stays on the ticket's record.`},{way:"wait",label:"Wait",note:`Starts by itself when ${p} ${o.length>1?"are":"is"} merged.`,off:c?"This is what it does now.":void 0}],x=y.find(v=>v.way===u&&!v.off),k={branch:`Building on ${p}'s branch`,anyway:`Building without ${p}`,wait:`It starts by itself once ${p} is merged`};return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"db",children:[t.jsxs("div",{className:"youbox",children:[t.jsx("span",{className:"ring",children:c?t.jsx(Ap,{size:15}):t.jsx(Tp,{size:15})}),t.jsxs("div",{children:[t.jsx("b",{children:c?`Waits for ${p} to merge`:e.waiting?.summary??`${e.id} needs ${p}, which is not merged yet`}),t.jsx("span",{children:c?`It starts by itself once ${p} ${o.length>1?"are":"is"} merged. You can still build it another way.`:`Its design uses work from ${p}, which is not in ${s} yet. Choose how to build.`})]})]}),t.jsx("div",{className:"lbl",children:"What it needs"}),o.map(v=>t.jsxs("div",{className:"trow",children:[t.jsx("span",{className:"mono",children:v.id}),t.jsx("b",{children:v.title}),t.jsxs("span",{className:"pill wait",children:[As[v.stage]," · not merged yet"]})]},v.id)),t.jsxs("div",{className:"lbl",children:["How to build ",e.id]}),t.jsx("div",{className:"opts2",style:{gridTemplateColumns:"1fr"},children:y.map(v=>t.jsxs("button",{className:`opt2 ${u===v.way&&!v.off?"pick":""}`,disabled:!!v.off,onClick:()=>d(v.way),children:[t.jsxs("b",{children:[v.label,u===v.way&&!v.off&&t.jsxs("span",{children:[t.jsx(xe,{size:13,strokeWidth:2.5})," Your pick"]})]}),v.off?`${v.note} ${v.off}`:v.note]},v.way))})]}),t.jsxs("div",{className:"df",children:[t.jsxs("button",{className:"btn pri",disabled:!x||n.isPending,onClick:()=>x&&n.mutate({path:`/api/v1/tickets/${e.id}/build`,body:{way:x.way},done:k[x.way]}),children:[x?.way==="wait"?t.jsx(Ap,{size:15}):t.jsx(Tp,{size:15})," ",x?x.label:"Pick a way"]}),t.jsx("span",{className:"grow"}),t.jsx(se,{text:`squad build ${e.id} ${VI[x?.way??"branch"]}`})]})]})}const YI={branch:(e,n)=>`Built on ${e}'s branch. The latest ${n} comes in once ${e} is merged.`,anyway:(e,n)=>`Built from ${n} without ${e}, as you chose.`,wait:e=>`Waits for ${e} to merge, then starts by itself.`};function QI({t:e}){const n=Em(e),s=Tm();if(!e.dependsOn?.length)return null;const r=e.dependency;return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"lbl",children:"Depends on"}),t.jsx("div",{className:"pills",children:e.dependsOn.map(a=>{const o=n.find(u=>u.id===a),c=!o||wo(o);return t.jsxs("span",{className:`pill ${c?"ok":"wait"}`,title:o?.title,children:[c&&t.jsx(xk,{size:13}),a,o?` ${o.title}`:""," · ",o?c?"merged":"not merged yet":"left the board"]},a)})}),r&&(r.way!=="wait"||!r.started)&&t.jsxs("p",{className:"note",style:{marginTop:6},children:[YI[r.way](r.on.join(" and "),s)," ",r.by," chose this."]})]})}function GI({t:e}){const n=Em(e).filter(o=>!wo(o));if(!n.length||e.waiting?.kind==="depends"||wo(e))return null;const s=n.map(o=>o.id).join(", "),r=e.dependency,a=r?.way==="branch"?`On ${s}'s branch`:r?.way==="wait"&&!r.started?`Waits for ${s}`:r?.way==="anyway"?`Without ${s}`:`Needs ${s}`;return t.jsx("span",{className:"prio owner",title:`Depends on ${s}, which is not merged yet`,children:a})}function ZI({t:e}){const n=pe(),s=Tm(),r=Qe(),a=r.data?.ready?r.data.meta.engine!=="live":!1;if(!["implement","test","review"].includes(e.stage)||wo(e)||e.takenOver||e.waiting&&!["proof","stuck"].includes(e.waiting.kind))return null;const o=!e.waiting&&(e.live||!!e.squad);return t.jsxs("button",{className:"btn sm",disabled:!!e.baseWanted||n.isPending,title:`squad bring-in ${e.id}`,onClick:()=>n.mutate({path:`/api/v1/tickets/${e.id}/bring-in`,done:a?"The sample board has no code, so nothing changed":o?`The latest ${s} comes in when this step ends, before the checks`:`Bringing in the latest ${s}`}),children:[t.jsx(xk,{size:13})," ",e.baseWanted?`${s} comes in after this step`:`Bring in latest ${s}`]})}function Am(e){const n=Qe(),s=n.data?.ready?n.data.meta.engine==="live":!0;return aP(e,s)}function Eb({t:e}){const n=pe(),s=at[Am(e)],r=rn(),a=Vi(Ki),o=()=>a?void r({to:"/conversations",search:{ticket:e.id}}):rs.show(e.id);return e.chat?.open?t.jsxs("button",{className:"btn sm askbtn",onClick:o,title:`The chat with the ${at[e.chat.with]} is open`,children:[t.jsx(Pn,{size:14})," Open the chat"]}):t.jsxs("button",{className:"btn sm askbtn",disabled:n.isPending,title:`The ${s} answers. ${e.id} stays where it is.`,onClick:()=>n.mutate({path:`/api/v1/tickets/${e.id}/chat/start`,body:{ask:!0}},{onSuccess:o}),children:[t.jsx(Pn,{size:14})," Ask a question"]})}const XI=e=>(e??"").replace(/^https?:\/\//,"").replace(/\/$/,"");function JI(e){return Pe({queryKey:["try",e],queryFn:()=>Ee(`/api/v1/tickets/${encodeURIComponent(e)}/try`),refetchInterval:n=>n.state.data?.state==="starting"?1e3:4e3})}function Pm({t:e}){const n=JI(e.id).data;return t.jsxs("div",{className:"yourcheck",children:[t.jsx(ez,{t:e,s:n}),t.jsx(OI,{t:e}),t.jsx(tz,{t:e,s:n})]})}function ez({t:e,s:n}){const s=nP(e),r=at[Am(e)];return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"lbl",children:"Where to look"}),s.length?t.jsx("ul",{className:"lookpages",children:s.map(a=>{const o=n?.state==="running"?n.pages?.find(u=>u.page===a)?.url:void 0,c=(e.proof??[]).filter(u=>Yc(u).includes(a)).map(u=>u.criterion);return t.jsxs("li",{children:[t.jsx("code",{children:a}),t.jsx("span",{className:"what",children:c.join(" · ")}),o&&t.jsxs("a",{className:"btn sm",href:o,target:"_blank",rel:"noreferrer",title:`Open ${o}`,children:[t.jsx(is,{size:13})," Open"]})]},a)})}):t.jsxs("p",{className:"note lookpages-none",children:["No page is saved for this story. Ask a question and the ",r," tells you where to look, or try it yourself."]})]})}function tz({t:e,s:n}){const s=pe(),r=n?.state??"off",a=()=>s.mutate({path:`/api/v1/tickets/${e.id}/try`,done:"Starting this story's own copy of the app"}),o=()=>s.mutate({path:`/api/v1/tickets/${e.id}/try/stop`,done:"Stopped it."}),c=r==="running"||r==="starting";return t.jsxs("div",{className:`trybox ${r}`,children:[t.jsxs("div",{className:"trybox-row",children:[t.jsx("span",{className:"ring","aria-hidden":"true",children:r==="starting"?t.jsx(jn,{size:15,className:"spin"}):t.jsx(Wi,{size:14})}),t.jsxs("div",{className:"trybox-t",children:[t.jsx("b",{children:r==="running"?"Running":r==="starting"?"Starting…":"Try it yourself"}),t.jsxs("span",{children:["Runs this story's own copy of the app, with the change in it. Nothing is merged.",r==="running"&&n?.url?t.jsxs(t.Fragment,{children:[" ","At ",t.jsx("span",{className:"mono",children:XI(n.url)}),"."]}):null]})]}),t.jsx("span",{className:"grow"}),t.jsxs("div",{className:"trybox-acts",children:[r==="running"&&n?.url&&t.jsxs("a",{className:"btn sm pri",href:n.url,target:"_blank",rel:"noreferrer",title:`Open ${n.url}`,children:[t.jsx(is,{size:13})," Open"]}),c&&t.jsxs("button",{className:"btn sm",disabled:s.isPending,onClick:o,children:[t.jsx(us,{size:11})," Stop"]}),!c&&n?.can&&t.jsx("button",{className:"btn sm",disabled:s.isPending,onClick:a,children:r==="failed"?"Try again":"Try it yourself"})]})]}),r==="failed"&&t.jsx("p",{className:"trybox-why",children:n?.error??"The app did not start."}),r==="failed"&&n?.detail&&t.jsxs("details",{className:"costdetails",children:[t.jsx("summary",{children:"See what failed"}),t.jsx("pre",{className:"app-out",children:n.detail})]}),!c&&n&&!n.can&&n.why&&t.jsx("p",{className:"trybox-why quiet",children:n.why}),!c&&n?.other&&n.can&&t.jsxs("p",{className:"trybox-why quiet",children:[n.other,"'s copy runs now. Trying this one stops it."]}),(c||n?.can)&&t.jsx(se,{text:c?`squad try ${e.id} --stop`:`squad try ${e.id}`})]})}function Tb(){return $.useSyncExternalStore(v6,k6)}function Ab({id:e,onClose:n}){const s=Ro(e),r=Gi(),{ticketFull:a,toggleTicketFull:o}=qe(),[c,u]=$.useState(null),[d,p]=$.useState("now");$.useEffect(()=>p("now"),[e]),$.useEffect(()=>{const m=y=>y.key==="Escape"&&!document.querySelector(".modal")&&n();return window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m)},[n]);const f=s.data;return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"veil",onClick:n}),t.jsx("aside",{className:`drawer ${a?"full":""}`,"aria-label":f?`${f.id} ${f.title}`:"Ticket",children:f?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"dh",children:[t.jsxs("div",{className:"dtop",children:[t.jsx("span",{className:"idtag",children:f.id}),f.source.type!=="manual"&&(f.source.url?t.jsxs("a",{className:"src",href:f.source.url,target:"_blank",rel:"noreferrer",children:[t.jsx(ls,{size:14})," ",f.source.itemType??"Item"," ",f.source.ref," ",t.jsx(is,{size:12})]}):t.jsxs("span",{className:"src",children:[t.jsx(ls,{size:14})," From ",f.source.ref]})),f.pr&&t.jsxs("a",{className:"src",href:f.pr.url,target:"_blank",rel:"noreferrer",children:[t.jsx(M6,{size:14})," Pull request ",f.pr.id," ",t.jsx(is,{size:12})]}),f.kind==="bug"&&t.jsxs("span",{className:"prio",children:["Bug",f.foundIn?` found in ${f.foundIn}`:""]}),f.priority==="high"&&f.kind!=="bug"&&t.jsx("span",{className:"prio",children:"High priority"}),t.jsx("span",{className:"grow"}),t.jsxs("span",{className:"dacts",children:[t.jsx(Eb,{t:f}),f.waiting?.kind==="proof"&&t.jsx(Te,{to:"/tickets/$id/proof",params:{id:f.id},className:"iconbtn","aria-label":"Open the proof page",children:t.jsx(is,{size:15})}),t.jsx("button",{className:"iconbtn",onClick:()=>Po.open({ticket:f.id}),"aria-label":"Report a problem",title:"Report a problem",children:t.jsx($f,{size:15})}),t.jsx(BI,{t:f,onDeleted:n,items:[...(Wn(f,r)||!r)&&wu(f)?[{key:"propose",label:t.jsxs(t.Fragment,{children:[t.jsx(cs,{size:15})," ",Ps(f)?"Ask for a change…":"Propose a change…"]}),onPick:()=>u("propose")}]:[],...CP(f,r)?[{key:"hand-over",label:t.jsxs(t.Fragment,{children:[t.jsx(Mc,{size:15})," Hand over…"]}),onPick:()=>u("hand-over")}]:[]]}),t.jsx("button",{className:"iconbtn fullbtn",onClick:o,"aria-pressed":a,"aria-label":a?"Back to the side panel":"Full width",title:a?"Back to the side panel":"Full width",children:a?t.jsx(vk,{size:15}):t.jsx(cu,{size:15})}),t.jsx("button",{className:"iconbtn",onClick:n,"aria-label":"Close",children:t.jsx(Xe,{size:16})})]})]}),c==="hand-over"&&t.jsx($P,{t:f,onClose:()=>u(null)}),c==="propose"&&t.jsx(Bo,{t:f,onClose:()=>u(null)}),t.jsx("h2",{children:f.title}),t.jsx(eR,{t:f}),t.jsxs("div",{className:"sub",children:[t.jsxs("span",{children:["Created by ",t.jsx("b",{children:f.createdBy})," ",nn(f.createdAt)," · ",t.jsx(JP,{t:f})]}),t.jsxs("span",{children:["Owner ",t.jsx("b",{children:Uo(f)}),Wn(f,r)?" (you)":""]}),f.repo&&t.jsxs("span",{children:["Repo ",t.jsx("b",{className:"mono",style:{fontSize:12.5},children:f.repo})]}),f.builder&&t.jsxs("span",{children:["Builder ",t.jsx("b",{children:f.builder})]}),f.reviewer&&t.jsxs("span",{children:["Reviewer ",t.jsx("b",{children:f.reviewer})]})]}),t.jsx(p8,{ticket:f})]}),t.jsxs("div",{className:"tabs",role:"tablist",children:[[["now","Now"],["story","Story"],["plan","Plan"],["activity","Activity"],["conversation","Conversation"],["proof","Proof"],["changes","Changes"],["cost","Cost"]].map(([m,y])=>t.jsxs("button",{className:d===m?"on":"",onClick:()=>p(m),children:[y,m==="now"&&(f.waiting||f.outdated?.length||Es(f)||ds(f))&&t.jsx("span",{className:"dot"})]},m)),t.jsxs("button",{className:`dev ${d==="developer"?"on":""}`,onClick:()=>p("developer"),children:[t.jsx($o,{size:15})," Developer"]})]}),d==="now"&&f.outdated?.length?t.jsx(hz,{t:f}):null,d==="now"&&ds(f)&&f.waiting?.kind!=="plan"&&(Wn(f,r)||!r)?t.jsx(kb,{t:f,banner:!0}):null,d==="now"&&t.jsx(EP,{t:f}),d==="now"&&t.jsx(UI,{t:f,onDeleted:n}),d==="now"&&(Wn(f,r)||!r)&&t.jsx(XA,{t:f}),d==="now"&&(Wn(f,r)||!r?t.jsx(nz,{t:f},f.id):t.jsx(TP,{t:f})),d==="story"&&t.jsx(gz,{t:f}),d==="plan"&&t.jsx(kz,{t:f}),d==="activity"&&t.jsx(vz,{t:f}),d==="conversation"&&t.jsx(pI,{t:f,onTab:p}),d==="proof"&&t.jsx(jz,{t:f}),d==="changes"&&t.jsx(TA,{t:f}),d==="cost"&&t.jsx("div",{className:"db",children:t.jsx(_R,{t:f})}),d==="developer"&&t.jsx(bz,{t:f})]}):t.jsx("div",{className:"center",children:s.isError?t.jsxs("div",{children:[t.jsx("p",{children:u8(s.error,e)}),t.jsx("button",{className:"btn",onClick:n,children:"Close"})]}):"Loading…"})})]})}function nz({t:e}){if(!e.waiting&&e.quiet)return t.jsx(dz,{t:e});if(HI(e))return t.jsx(KI,{t:e});switch(e.waiting?.kind){case"questions":return t.jsx(rz,{t:e});case"spec":case"plan":return t.jsx(az,{t:e});case"proof":return t.jsx(cz,{t:e});case"stuck":return t.jsx(_A,{t:e,extra:t.jsxs(t.Fragment,{children:[t.jsx(Xi,{t:e}),e.stuck?.gate==="proof"&&e.proof?.some(n=>n.after)&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"lbl",children:"What the screenshots show"}),t.jsx(Im,{t:e})]}),Wo(e)&&t.jsx(Pm,{t:e}),t.jsx(qi,{t:e})]})});case"ask":return t.jsx(uz,{t:e});case"yours":return t.jsx(fz,{t:e});case"chat":return e.chat?t.jsx(sz,{t:e}):t.jsx(uf,{t:e});default:return t.jsx(uf,{t:e})}}function sz({t:e}){const n=at[e.chat.with];return t.jsx("div",{className:"db",children:t.jsxs("div",{className:"youbox",children:[t.jsx("span",{className:"ring",children:t.jsx(Pn,{size:15})}),t.jsxs("div",{children:[t.jsxs("b",{children:["Talking it through with the ",n]}),t.jsx("span",{children:"The talk is open in the chat panel beside the board. Its work waits until you press a button there."})]}),t.jsx("span",{className:"grow"}),t.jsx(Te,{to:"/conversations",search:{ticket:e.id},className:"btn sm",children:"Full screen"})]})})}function rz({t:e}){const n=pe(),s=Object.fromEntries((e.questions??[]).filter(y=>y.answer).map(y=>[y.id,y.answer])),[r,a,o]=we(e.id,"answers",s),[c,u]=$.useState(!1),d=Object.keys(r).length,p=e.questions??[],f=[{from:"analyst",label:"From the Analyst, about what to build"},{from:"architect",label:"From the Architect, about how to build it"}],m=p.every(y=>{const x=r[y.id];return x?x.choice===y.inputOption||x.choice==="Other"?!!x.value?.trim():!0:!1});return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"db",children:f.map(y=>{const x=p.filter(k=>k.from===y.from);return x.length?t.jsxs("div",{className:"qblock",children:[t.jsxs("div",{className:"qgroup",children:[t.jsx(Hr,{role:y.from,small:!0}),y.label]}),x.map(k=>t.jsx(iz,{t:e,q:k,n:p.indexOf(k)+1,answer:r[k.id],onAnswer:v=>a(b=>({...b,[k.id]:v}))},k.id))]},y.from):null})}),t.jsxs("div",{className:"df",children:[t.jsxs("button",{className:"btn pri",disabled:!m||n.isPending,onClick:()=>n.mutate({path:`/api/v1/tickets/${e.id}/answers`,body:{answers:r},done:"Answers sent. The Architect is choosing the design."},{onSuccess:o}),children:[t.jsx(hs,{size:15})," Send answers"]}),t.jsx("button",{className:"btn",disabled:n.isPending,onClick:()=>{if(d>0&&!c)return u(!0);n.mutate({path:`/api/v1/tickets/${e.id}/skip`,done:"The squad made its own guesses. You will see them in the plan."},{onSuccess:o})},children:c?`Skip and lose your ${d===1?"answer":`${d} answers`}?`:"Skip, let the squad guess"}),c&&t.jsx("button",{className:"btn quiet",onClick:()=>u(!1),children:"Keep them"}),t.jsx(Zr,{t:e,agent:"analyst",label:"Talk it through instead"}),t.jsx("span",{className:"grow"}),t.jsx(se,{text:`squad answer ${e.id}`})]})]})}function iz({t:e,q:n,n:s,answer:r,onAnswer:a}){const o=pe(),[c,u]=we(e.id,`ask-${n.id}`,""),[d,p]=$.useState(!!c),f=()=>{c.trim()&&(o.mutate({path:`/api/v1/tickets/${e.id}/ask`,body:{questionId:n.id,text:c}}),u(""),p(!1))},m=[...n.options,"Other"];return t.jsxs("div",{className:"q",children:[t.jsxs("h4",{children:[s,". ",n.text]}),(n.thread?.length||n.thinking)&&t.jsxs("div",{className:"thread",children:[n.thread?.map((y,x)=>t.jsxs("div",{className:`msg ${y.who==="you"?"":"squad"}`,children:[t.jsx("small",{children:y.who==="you"?"You":$s[y.who]}),y.text]},x)),n.thinking&&t.jsxs("div",{className:"msg squad",children:[t.jsx("small",{children:$s[n.from]}),t.jsxs("span",{className:"typing","aria-label":"Writing a reply",children:[t.jsx("i",{}),t.jsx("i",{}),t.jsx("i",{})]})]})]}),t.jsx("div",{className:"choices",children:m.map(y=>{const x=r?.choice===y,k=y===n.inputOption||y==="Other";return t.jsxs("div",{className:`choice ${x?"on":""}`,role:"radio","aria-checked":x,tabIndex:0,onClick:()=>!x&&a({choice:y}),onKeyDown:v=>v.target===v.currentTarget&&v.key==="Enter"&&!x&&a({choice:y}),children:[t.jsx("span",{className:"rd"}),y==="Other"?"Other":y.replace(/:$/,""),k&&x&&t.jsx("input",{autoFocus:!0,value:r?.value??"",placeholder:y==="Other"?"Your answer":"Which one?",onChange:v=>a({choice:y,value:v.target.value}),onClick:v=>v.stopPropagation()})]},y)})}),d?t.jsxs("div",{className:"askrow",children:[t.jsx("input",{className:"input",autoFocus:!0,value:c,onChange:y=>u(y.target.value),placeholder:`Ask the ${$s[n.from]} about this question`,onKeyDown:y=>y.key==="Enter"&&f()}),t.jsx("button",{className:"btn",onClick:f,disabled:!c.trim(),children:"Ask"})]}):t.jsxs("button",{className:"asklink",onClick:()=>p(!0),disabled:n.thinking,children:[t.jsx(Pn,{size:14})," Ask about this"]})]})}function Jc({t:e,review:n}){return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"lbl",children:"The story"}),t.jsx(dc,{review:n,at:{part:"story"},children:t.jsx("p",{className:"story",children:e.story})}),e.criteria&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"lbl",children:"Done when"}),t.jsx("ol",{className:"ac",children:e.criteria.map((s,r)=>t.jsx("li",{children:t.jsx(dc,{review:n,at:{part:"criterion",index:r},children:t.jsxs("span",{children:[t.jsx("em",{children:"Given"})," ",s.given,", ",t.jsx("em",{children:"when"})," ",s.when,", ",t.jsx("em",{children:"then"})," ",s.then,"."]})})},r))})]}),e.decision&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"lbl",children:["The Architect's decision ",e.decision.adr&&t.jsxs("span",{className:"pill ok",children:["Saved as ",e.decision.adr]})]}),t.jsx(dc,{review:n,at:{part:"decision"},children:t.jsxs("div",{className:"decision",children:[t.jsxs("h3",{children:[t.jsx(Hr,{role:"architect",small:!0}),e.decision.title]}),t.jsx("div",{className:"opts2",children:e.decision.options.map(s=>t.jsxs("div",{className:`opt2 ${s.chosen?"pick":""}`,children:[t.jsxs("b",{children:[s.name,s.chosen&&t.jsxs("span",{children:[t.jsx(xe,{size:13,strokeWidth:2.5})," Chosen"]})]}),s.note]},s.name))}),t.jsxs("div",{className:"why",children:[t.jsxs("span",{children:[t.jsx("b",{children:"Why"})," ",e.decision.why]}),e.decision.clientCheck&&t.jsxs("span",{children:[t.jsx("b",{children:"Client's choice"})," ",e.decision.clientCheck]}),e.decision.replaces&&t.jsxs("span",{children:[t.jsx("b",{children:"Replaces"})," ",e.decision.replaces,". Once you approve, it is no longer a rule and later tickets follow this one."]})]})]})})]}),e.work&&e.follows&&e.follows.length>0&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"lbl",children:"Follows saved decisions"}),t.jsx("div",{className:"pills",children:e.follows.map(s=>t.jsx(Te,{to:"/architecture",search:{adr:s},className:"pill",children:s},s))})]}),e.work&&t.jsx(QI,{t:e}),e.mockup&&e.work&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"lbl",children:"How it will look"}),t.jsx(im,{ticket:e.id,file:e.mockup,title:`${e.title}: mockup`})]}),e.work&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"lbl",children:"The work"}),t.jsxs("div",{className:"pills",children:[t.jsxs("span",{className:"pill",children:[e.work.steps," small steps"]}),t.jsxs("span",{className:"pill",children:[e.work.tests," new tests"]}),e.work.screens>0&&t.jsxs("span",{className:"pill",children:[e.work.screens," before and after screens"]})]})]}),e.work&&t.jsx(kb,{t:e}),n&&e.work&&e.steps&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"lbl",children:"Build steps"}),t.jsx("ol",{className:"ac",children:e.steps.map((s,r)=>t.jsx("li",{children:t.jsx(dc,{review:n,at:{part:"step",index:r},children:t.jsx("span",{children:s.title})})},r))})]})]})}function az({t:e}){const n=pe(),s=`plan-${e.waiting?.kind??"plan"}`,[r,a,o]=we(e.id,`${s}-mode`,null),[c,u,d]=we(e.id,`${s}-note`,""),[p,f]=$.useState(!1),[m,y,x]=we(e.id,`${s}-comments`,[]),k=()=>{o(),d(),x()},v=e.waiting?.kind==="spec",b=!v&&!!e.specApproved,N=v?"the Analyst":b?"the Architect":"the Spec writer",C={t:e,comments:m,add:M=>y(T=>[...T,M]),remove:M=>y(T=>T.filter((F,R)=>R!==M)),canEdit:M=>v?M.part==="story"||M.part==="criterion":M.part==="step"||!b&&(M.part==="story"||M.part==="criterion")},S=()=>r==="over"?n.mutate({path:`/api/v1/tickets/${e.id}/plan/start-over`,body:{direction:c},done:`Starting over. ${N[0].toUpperCase()}${N.slice(1)} writes it again.`},{onSuccess:k}):n.mutate({path:`/api/v1/tickets/${e.id}/change`,body:{text:c},done:`Sent to ${N}.`},{onSuccess:k}),P=m.length;return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"db",children:[(v||b)&&t.jsxs("div",{className:"twostep",children:[t.jsxs("span",{className:v?"on":"done",children:[v?"1":t.jsx(xe,{size:12,strokeWidth:3})," The what"]}),t.jsx("span",{className:"bar"}),t.jsx("span",{className:b?"on":"",children:"2 The how"}),t.jsx("p",{children:v?'Is this what you want? Check the story and the "done when" list. The Architect designs how to build it after you approve.':`The spec was approved by ${e.specApproved.by}. Now check how the Architect will build it. A developer can approve this part for you.`})]}),t.jsx($I,{t:e}),t.jsx("p",{className:"note reviewhint",children:"Point at any part to comment on it or edit it yourself. Send back sends every comment at once."}),v?t.jsx(Jc,{t:{...e,decision:void 0,work:void 0},review:C}):t.jsx(Jc,{t:e,review:C}),!v&&e.decision&&t.jsx("p",{className:"note",style:{marginTop:14},children:"Approved decisions are saved in Decisions. Later tickets must follow them."})]}),r?t.jsxs("div",{className:"df",children:[t.jsx("input",{className:"input",style:{flex:1},autoFocus:!0,value:c,onChange:M=>u(M.target.value),placeholder:r==="over"?"What is the new direction? It is written again from zero.":"What should change? One line is enough.",onKeyDown:M=>M.key==="Enter"&&c.trim()&&!n.isPending&&S()}),t.jsx("button",{className:"btn pri",disabled:!c.trim()||n.isPending,onClick:S,children:r==="over"?"Start over":"Send"}),t.jsx("button",{className:"btn",onClick:()=>a(null),children:"Cancel"})]}):t.jsxs("div",{className:"df",children:[P>0?t.jsxs("button",{className:"btn pri",disabled:n.isPending,onClick:()=>n.mutate({path:`/api/v1/tickets/${e.id}/plan/send-back`,body:{comments:m},done:`Sent back to ${N} with ${P} ${P===1?"comment":"comments"}.`},{onSuccess:k}),children:[t.jsx(hs,{size:15})," Send back (",P,")"]}):t.jsxs("button",{className:"btn pri",disabled:n.isPending,onClick:()=>n.mutate({path:`/api/v1/tickets/${e.id}/approve`,done:v?"Spec approved. The Architect is designing how to build it.":"Plan approved. The Builder started."},{onSuccess:k}),children:[t.jsx(xe,{size:15,strokeWidth:2.5})," ",v?"Approve spec":b?"Approve design":"Approve plan"]}),P===0&&t.jsx("button",{className:"btn",onClick:()=>a("change"),children:"Change something"}),(v||b)&&t.jsx(Zr,{t:e,agent:v?"analyst":"architect",label:"Talk it through"}),t.jsx("button",{className:"btn quiet",onClick:()=>a("over"),children:"Start over"}),t.jsx("button",{className:"btn quiet",onClick:()=>f(!0),children:"Ask a developer"}),t.jsx("span",{className:"grow"}),t.jsx(se,{text:P>0?`squad send-back ${e.id} ${m.map(M=>Le(`${oz(M)}: ${M.text}`)).join(" ")}`:`squad approve ${e.id}`})]}),p&&t.jsx(lz,{t:e,onClose:()=>f(!1)})]})}function oz(e){return e.part==="criterion"?`done when ${(e.index??0)+1}`:e.part==="step"?`step ${(e.index??0)+1}`:e.part}function lz({t:e,onClose:n}){const{toast:s}=qe(),r=`Hi, can you check the plan for ${e.id} "${e.title}" before I approve it? It's on the board, or run: squad show ${e.id}`;return t.jsxs(Ve,{title:"Ask a developer",onClose:n,footer:t.jsxs(t.Fragment,{children:[t.jsxs("button",{className:"btn pri",onClick:()=>void navigator.clipboard?.writeText(r).then(()=>s("Message copied")),children:[t.jsx(ur,{size:15})," Copy message"]}),t.jsx("button",{className:"btn",onClick:n,children:"Close"})]}),children:[t.jsx("p",{children:"Send this to a developer on your team. They can read the plan in the terminal and tell you what they think."}),t.jsx("div",{className:"wa",children:r})]})}function Rm({t:e}){const n=e.gates;return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"pills",children:[t.jsx(Fr,{state:n?.checks,text:vb(n)}),t.jsx(Fr,{state:n?.review,text:n?.review==="pass"?`Review approved by ${n.reviewBy}`:n?.review==="skipped"?"Review notes open, you continued":"Review approved"}),t.jsx(Fr,{state:n?.proof,text:jb(e)})]}),t.jsx(wb,{g:n}),e.overrides?.map(s=>t.jsxs("p",{className:"note override",children:[t.jsx("b",{children:"Continued anyway"})," past the ",FI(s),", by ",s.by,": ",s.reason]},s.at))]})}function Im({t:e}){const[n,s]=$.useState(null);if(!e.proof?.length)return t.jsxs(t.Fragment,{children:[t.jsx("p",{className:"note",children:bb(e)}),t.jsx(lf,{t:e})]});const{pictures:r,starts:a}=Nb(e.proof,o=>Cs(`/api/v1/proof/${o}`));return t.jsxs(t.Fragment,{children:[n!==null&&t.jsx(Gr,{pictures:r,start:n,onClose:()=>s(null)}),e.proof.map((o,c)=>t.jsxs("div",{className:`critrow ${$m(o.shows)}`,children:[t.jsxs("h5",{children:[t.jsx(Sb,{shows:o.shows}),o.criterion,t.jsx(of,{shows:o.shows})]}),bo(o)&&t.jsx("p",{className:"verdictnote",children:bo(o)}),Br(o)&&t.jsxs("p",{className:"critpage",children:["Page ",t.jsx("code",{children:Br(o)})]}),t.jsxs("div",{className:"proofmini",children:[t.jsxs("div",{children:[t.jsx("small",{children:o.beforeLabel}),t.jsx("button",{className:"zoom",onClick:()=>s(a[c]),"aria-label":`Open ${o.beforeLabel} full size`,children:t.jsx("img",{src:Cs(`/api/v1/proof/${o.before}`),alt:`${o.criterion}, ${o.beforeLabel}`})})]}),t.jsxs("div",{children:[t.jsx("small",{children:o.afterLabel}),t.jsx("button",{className:"zoom",onClick:()=>s(a[c]+1),"aria-label":`Open ${o.afterLabel} full size`,children:t.jsx("img",{src:Cs(`/api/v1/proof/${o.after}`),alt:`${o.criterion}, ${o.afterLabel}`})})]})]}),o.more?.length&&o.why&&o.note?t.jsx("p",{className:"note proofmore-main",children:o.note}):null,t.jsx(Cb,{shot:o,first:a[c]+2,onOpen:s})]},o.criterion)),t.jsx(lf,{t:e})]})}function Pb({t:e,sticky:n}){const s=pe(),[r,a,o]=we(e.id,"proof-wrong",""),[c,u]=$.useState(!!r),d=()=>{s.isPending||s.mutate({path:`/api/v1/tickets/${e.id}/change`,body:{text:r},done:"Sent back to the Builder with your note."},{onSuccess:o})};return c?t.jsxs("div",{className:n?"stickybar":"df",children:[t.jsx("input",{className:"input",style:{flex:1},autoFocus:!0,value:r,onChange:p=>a(p.target.value),placeholder:"What's wrong? Tell the squad in one line.",onKeyDown:p=>p.key==="Enter"&&r.trim()&&d()}),t.jsx("button",{className:"btn pri",disabled:!r.trim()||s.isPending,onClick:d,children:"Send back"}),t.jsx("button",{className:"btn",onClick:()=>u(!1),children:"Cancel"})]}):t.jsxs("div",{className:n?"stickybar":"df",children:[t.jsxs("button",{className:"btn pri",disabled:s.isPending,onClick:()=>s.mutate({path:`/api/v1/tickets/${e.id}/approve`,done:`${e.id} is ready to release.`}),children:[t.jsx(xe,{size:15,strokeWidth:2.5})," Looks right"]}),t.jsx("button",{className:"btn",onClick:()=>u(!0),children:"Something's wrong"}),t.jsx("span",{className:"grow"}),t.jsx(se,{text:`squad approve ${e.id}`})]})}function cz({t:e}){return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"db",children:[t.jsxs("div",{className:"youbox",children:[t.jsx("span",{className:"ring",children:t.jsx(xe,{size:18,strokeWidth:2.5})}),t.jsxs("div",{children:[t.jsx("b",{children:"Check that it works the way you want"}),t.jsx("span",{children:MI(e.gates)})]}),t.jsx("span",{className:"grow"}),t.jsxs(Te,{to:"/tickets/$id/proof",params:{id:e.id},className:"btn sm",children:[t.jsx(is,{size:14})," Full page"]})]}),t.jsx("div",{className:"lbl",children:"Gates, checked by squad-kit"}),t.jsx(Rm,{t:e}),t.jsx(Xi,{t:e}),t.jsx("div",{className:"lbl",children:"Before and after"}),t.jsx(Im,{t:e}),t.jsx(Pm,{t:e})]}),t.jsx(Pb,{t:e})]})}const op="Decide yourself: take the simplest choice that fits the plan, and say what you chose";function uz({t:e}){const n=pe(),s=e.agentQuestion,[r,a,o]=we(e.id,"agent-pick",null),[c,u,d]=we(e.id,"agent-own","");if(!s)return t.jsx(uf,{t:e});if(s.port)return t.jsx(II,{t:e});if(s.kind)return t.jsx(sR,{t:e,extra:t.jsxs(t.Fragment,{children:[t.jsx(Xi,{t:e}),t.jsx(qi,{t:e})]})});const p={architect:"Architect",builder:"Builder",reviewer:"Reviewer"}[s.from],f=r===""?c.trim():r,m=[...s.options,op];return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"db",children:[t.jsxs("div",{className:"youbox",children:[t.jsx("span",{className:"ring",children:"?"}),t.jsxs("div",{children:[t.jsxs("b",{children:["The ",p," has a question"]}),t.jsx("span",{children:"It stopped instead of guessing. Your answer goes back into the same conversation, and the work carries on."})]})]}),t.jsxs("div",{className:"lbl",children:[p," asks"]}),t.jsx("p",{className:"stuckq",children:s.text}),s.why&&t.jsxs("p",{className:"note",style:{marginTop:-4},children:["Why it matters: ",s.why]}),s.files&&s.files.length>0&&t.jsx(mj,{ticket:e.id,files:s.files}),t.jsxs("div",{className:"opts2",children:[m.map(y=>t.jsxs("button",{className:`opt2 ${r===y?"pick":""}`,onClick:()=>a(y),children:[t.jsxs("b",{children:[y===op?"Let it decide":y,r===y&&t.jsxs("span",{children:[t.jsx(xe,{size:13,strokeWidth:2.5})," Your pick"]})]}),y===op?"It takes the simplest choice that fits the plan and tells you which.":""]},y)),t.jsx("button",{className:`opt2 ${r===""?"pick":""}`,onClick:()=>a(""),children:t.jsx("b",{children:"Write my own answer"})})]}),r===""&&t.jsx("textarea",{className:"input",rows:3,style:{width:"100%",marginTop:8},autoFocus:!0,value:c,placeholder:"Your answer",onChange:y=>u(y.target.value)}),t.jsx(qi,{t:e})]}),t.jsxs("div",{className:"df",children:[t.jsxs("button",{className:"btn pri",disabled:!f||n.isPending,onClick:()=>n.mutate({path:`/api/v1/tickets/${e.id}/reply`,body:{text:f},done:`Sent. The ${p} carries on.`},{onSuccess:()=>{o(),d()}}),children:[t.jsx(hs,{size:15})," Send answer"]}),t.jsx("span",{className:"grow"}),t.jsx(se,{text:`squad reply ${e.id}${f?` ${Le(f.length>40?`${f.slice(0,40)}…`:f)}`:""}`})]})]})}function dz({t:e}){return t.jsxs("div",{className:"db",children:[t.jsx(AI,{t:e}),e.now&&t.jsx(gb,{t:e}),t.jsx(xb,{t:e}),t.jsx(yb,{t:e})]})}function hz({t:e}){const n=pe(),[s,r]=$.useState(null),[a,o,c]=we(e.id,"keep-reason",""),u=!!e.mergedAt||e.stage==="done";return t.jsx("div",{className:"outdated",children:e.outdated.map(d=>t.jsxs("div",{className:"outdated-item",children:[t.jsxs("div",{className:"outdated-head",children:[t.jsx("span",{className:"ic",children:t.jsx(dr,{size:15})}),t.jsxs("b",{children:[t.jsx(Te,{to:"/architecture",search:{adr:d.adr},children:d.adr})," came after this plan and changes it"]})]}),t.jsx("p",{children:d.why}),t.jsxs("p",{children:[t.jsx("span",{className:"note",children:u?"What a follow-up would change:":"What would change:"})," ",d.change]}),s===d.adr?t.jsxs("div",{className:"row",children:[t.jsx("input",{className:"input",autoFocus:!0,value:a,onChange:p=>o(p.target.value),placeholder:"Why the plan stays as it is"}),t.jsx("button",{className:"btn sm",disabled:!a.trim()||n.isPending,onClick:()=>n.mutate({path:`/api/v1/tickets/${e.id}/decision-update`,body:{adr:d.adr,do:"keep",reason:a},done:"Kept the plan. The reason is on the ticket."},{onSuccess:()=>{r(null),c()}}),children:"Keep it"}),t.jsx("button",{className:"btn sm quiet",onClick:()=>r(null),children:"Cancel"})]}):t.jsxs("div",{className:"row",children:[t.jsx("button",{className:"btn sm pri",disabled:n.isPending,onClick:()=>n.mutate({path:`/api/v1/tickets/${e.id}/decision-update`,body:{adr:d.adr,do:"update"},done:u?"Made a follow-up ticket.":"The Architect is updating the plan."}),children:u?"Make a follow-up ticket":"Update the plan"}),t.jsx("button",{className:"btn sm",onClick:()=>{r(d.adr),o("")},children:"Keep it as is"})]})]},d.adr))})}function pz({t:e}){const n=pe(),s=e.localSetup,r=s.status==="pending"||s.status==="running";return t.jsxs("div",{className:`localsetup ${s.status}`,children:[t.jsx("span",{className:"ic",children:r?t.jsx(jn,{size:15,className:"spin"}):s.status==="done"?t.jsx(xe,{size:15,strokeWidth:2.5}):t.jsx(dr,{size:15})}),t.jsxs("div",{children:[t.jsx("b",{children:r?"Updating your copy of the code":s.status==="done"?"Your copy of the code is ready to run":"Your copy of the code needs a hand"}),t.jsx("span",{children:r?"The merge changed your own folder, so the squad installs new packages and runs the database changes there.":s.status==="done"?`New packages and database changes are in your own folder${s.at?`, ${nn(s.at)}`:""}${s.seconds!==void 0?` (${s.seconds} s)`:""}.`:"squad-kit could not finish setting it up. Try again, or ask an engineer to look at what failed."}),s.status==="failed"&&t.jsxs("details",{className:"costdetails",children:[t.jsx("summary",{children:"See what failed"}),t.jsx("code",{children:s.command}),s.output&&t.jsx("pre",{children:s.output})]})]}),s.status==="failed"&&t.jsx("button",{className:"btn sm",disabled:n.isPending,onClick:()=>n.mutate({path:`/api/v1/tickets/${e.id}/local-setup`,done:"Running the setup again"}),children:"Try again"})]})}function uf({t:e}){const n=Tb(),s=Gi(),r=pe(),a=Am(e),o=e.stage==="release"?{title:`Ready for ${e.release}`,text:"It goes out with the next release. Nothing needed from you until then."}:e.stage==="done"?{title:e.status,text:"This ticket is live. Found a problem? Report a bug and it comes back around."}:e.waiting?.kind==="change"?{title:"The Builder paused for your change",text:"The Architect updated the design. Approve it above, or decline the change and the Builder carries on."}:{title:"Nothing needed from you",text:`${mz(e)} You'll get a card when the squad needs you.`},c=fb(e);return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"db",children:[c?t.jsx(gb,{t:e}):t.jsxs("div",{className:"calm",children:[t.jsx("span",{className:"ring",children:e.stage==="release"?t.jsx(os,{size:18}):t.jsx(xe,{size:18,strokeWidth:2.5})}),t.jsxs("div",{children:[t.jsx("b",{children:o.title}),t.jsx("span",{children:o.text})]}),e.stage==="release"&&t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"grow",style:{flex:1}}),t.jsx(Te,{to:"/releases",className:"btn sm",children:"Open release"})]})]}),e.localSetup&&t.jsx(pz,{t:e}),e.steps&&e.steps.length>0&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"lbl",children:"Steps"}),t.jsx(Rb,{t:e})]}),e.gates&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"lbl",children:"Gates, checked by squad-kit"}),t.jsx(Rm,{t:e})]}),t.jsx(Xi,{t:e}),(e.stage==="release"||e.stage==="done")&&e.usage?.length?t.jsx(MR,{t:e}):null,t.jsx(mm,{t:e}),c?t.jsx(xb,{t:e}):t.jsx(qi,{t:e}),t.jsx(yb,{t:e})]}),t.jsxs("div",{className:"df",children:[e.live&&e.stage!=="release"&&e.stage!=="done"&&t.jsxs("button",{className:"btn sm",disabled:e.stopRequested||r.isPending,onClick:()=>r.mutate({path:`/api/v1/tickets/${e.id}/stop`,done:"Stopping the squad"}),children:[t.jsx(us,{size:12})," ",e.stopRequested?"Stopping…":"Stop"]}),um(e)&&t.jsx(dm,{t:e}),t.jsx(ZI,{t:e}),!e.chat?.open&&!e.takenOver&&!Ps(e)&&a!=="analyst"&&t.jsx(Zr,{t:e,agent:"analyst",label:"Ask the Analyst"}),(Wn(e,s)||!s)&&t.jsx(JA,{t:e}),t.jsx("span",{className:"note",children:e.live?n==="down"?"Not updating: squad-kit has stopped.":"Updates live as the squad works.":""}),t.jsx("span",{className:"grow"}),t.jsx(se,{text:e.live&&e.stage!=="release"?`squad stop ${e.id}`:Ef(e)})]})]})}function fz({t:e}){const n=pe(),[s,r,a]=we(e.id,"give-back",""),o=e.takenOver;return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"db",children:[t.jsxs("div",{className:"youbox",children:[t.jsx("span",{className:"ring",children:t.jsx($o,{size:15})}),t.jsxs("div",{children:[t.jsx("b",{children:"You have this ticket"}),t.jsx("span",{children:"The squad stopped and waits. Nothing runs until you give it back."})]})]}),t.jsx("div",{className:"lbl",children:"1. Open the Builder's session in Claude Code"}),t.jsx(se,{text:`cd ${Le(o.cwd)} && claude --resume ${o.session}`}),t.jsx("p",{className:"note",style:{fontSize:12.5,marginTop:6},children:"It is the same conversation the Builder had, in the ticket's own copy of the code. Your folder is not touched. Or just edit the files:"}),t.jsx(ju,{t:e}),t.jsx("div",{className:"lbl",children:"2. Give it back"}),t.jsx("textarea",{className:"waynote",rows:2,value:s,onChange:c=>r(c.target.value),placeholder:"What did you change? (optional, every agent reads it)"}),t.jsx("p",{className:"note",style:{fontSize:12.5},children:"Then squad-kit runs the checks, the Reviewer reads all the changes, yours too, and the Tester makes the proof again."}),t.jsx(qi,{t:e})]}),t.jsxs("div",{className:"df",children:[t.jsxs("button",{className:"btn pri",disabled:n.isPending,onClick:()=>n.mutate({path:`/api/v1/tickets/${e.id}/give-back`,body:{note:s},done:"Given back. The checks run on your changes."},{onSuccess:a}),children:[t.jsx(xe,{size:15,strokeWidth:2.5})," Give back"]}),t.jsx("span",{className:"grow"}),t.jsx(se,{text:`squad give-back ${e.id}${s.trim()?` ${Le(s.trim())}`:""}`})]})]})}function mz(e){const n=e.steps??[],s=n.findIndex(r=>r.status==="doing");return e.stage==="implement"&&s>=0?`The Builder is on step ${s+1} of ${n.length}.`:e.stage==="test"?"squad-kit is running the project checks.":e.stage==="review"?"The Reviewer is checking the work.":e.stage==="tickets"?"The Analyst is reading the ticket.":e.stage==="specs"?"The Architect is writing the plan.":`${e.status}.`}function Rb({t:e}){return t.jsx("ul",{className:"steps",children:e.steps.map((n,s)=>t.jsxs("li",{className:n.status==="doing"?"now":n.status==="todo"?"todo":"",children:[t.jsx("span",{className:`sd ${n.status==="done"?"ok":n.status==="doing"?"now":""}`,children:n.status==="done"&&t.jsx(xe,{size:11,strokeWidth:3})}),t.jsxs("span",{children:[n.status==="doing"?t.jsx("b",{style:{fontWeight:600},children:n.title}):n.title,n.live&&t.jsxs("span",{className:"livetxt",children:[t.jsx("span",{className:"live"}),n.live]})]}),t.jsx("span",{className:"time",children:n.status==="done"?`${n.minutes??1} min`:n.status==="doing"?"now":""})]},s))})}function qi({t:e,all:n}){const s=n?e.activity:e.activity.slice(0,4);return s.length?t.jsxs(t.Fragment,{children:[!n&&t.jsx("div",{className:"lbl",children:"Latest activity"}),t.jsx("div",{className:"feed",children:s.map((r,a)=>t.jsxs("div",{className:"fe",children:[t.jsx("span",{className:"tm",children:Rn(r.at)}),t.jsx(Hr,{role:r.who,small:!0}),t.jsxs("span",{children:[t.jsx("b",{children:$s[r.who]})," ",r.text.charAt(0).toLowerCase()+r.text.slice(1)]})]},r.at+a))})]}):null}function gz({t:e}){return t.jsxs("div",{className:"db",children:[t.jsx("div",{className:"lbl",children:"What was asked"}),t.jsx("p",{className:"story",style:{whiteSpace:"pre-wrap"},children:e.ask}),t.jsx(cp,{head:"Your acceptance criteria",items:e.brief?.criteria}),t.jsx(cp,{head:"Business rules",items:e.brief?.rules}),t.jsx(cp,{head:"Edge cases",items:e.brief?.edgeCases}),t.jsx(yz,{t:e}),t.jsx(xz,{t:e}),t.jsx(tP,{t:e}),t.jsx(mm,{t:e}),e.story?t.jsx(Jc,{t:{...e,decision:void 0,work:void 0}}):t.jsx("p",{className:"note",style:{marginTop:16},children:"The Analyst writes the user story after your answers."})]})}const lp=[{kind:"note",label:"Note",head:"Note",hint:"Anything the squad should know"},{kind:"rule",label:"Business rule",head:"Rule",hint:"For example: at most 3 bookings a day per person"},{kind:"criterion",label:"Acceptance criterion",head:"Done when",hint:"The Tester must prove it, for example: the clerk sees an error on the 4th booking"}];function xz({t:e}){const n=pe(),[s,r]=$.useState("note"),[a,o]=we(e.id,"note",""),c=e.notes??[],u=e.stage!=="done",d=lp.find(f=>f.kind===s),p=()=>n.mutate({path:`/api/v1/tickets/${e.id}/notes`,body:{text:a,kind:s},done:e.live?"Added. The squad reads it at its next step.":"Added. Every agent on this ticket reads it."},{onSuccess:()=>o("")});return!u&&!c.length?null:t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"lbl",children:["Notes",c.length?` · ${c.length}`:""]}),c.length>0&&t.jsx("ul",{className:"ticketnotes",children:c.map((f,m)=>t.jsxs("li",{children:[t.jsx("span",{className:`pill ${f.kind==="criterion"?"ok":f.kind==="rule"?"wait":""}`,children:lp.find(y=>y.kind===f.kind)?.head}),t.jsx("span",{className:"grow",children:f.text}),t.jsxs("span",{className:"note",children:[f.by," · ",nn(f.at)]})]},m))}),u&&t.jsxs("div",{className:"addnote",children:[t.jsx("div",{className:"seg",style:{width:"fit-content"},children:lp.map(f=>t.jsx("button",{className:s===f.kind?"on":"",onClick:()=>r(f.kind),children:f.label},f.kind))}),t.jsx("textarea",{className:"input",rows:2,value:a,placeholder:d.hint,onChange:f=>o(f.target.value),onKeyDown:f=>{f.key==="Enter"&&(f.metaKey||f.ctrlKey)&&a.trim()&&p()}}),t.jsxs("div",{style:{display:"flex",gap:10,alignItems:"center"},children:[t.jsxs("button",{className:"btn pri sm",disabled:!a.trim()||n.isPending,onClick:p,children:["Add ",d.label.toLowerCase()]}),t.jsxs("span",{className:"note",children:["Every agent on this ticket reads it",e.live?", the one working now from its next step":"","."]}),t.jsx("span",{className:"grow"}),t.jsx(se,{text:`squad note ${e.id}${s==="note"?"":` --${s}`} ${Le(a.trim()||"…")}`})]})]})]})}function cp({head:e,items:n}){return n?.length?t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"lbl",children:e}),t.jsx("ul",{className:"brief",children:n.map((s,r)=>t.jsx("li",{children:s},r))})]}):null}const e2=/\.(png|jpe?g|gif|webp|bmp)$/i;function yz({t:e}){const[n,s]=$.useState(null),r=e.attachments??[];if(!r.length)return null;const a=u=>u.split(/[\\/]/).pop()??u,o=r.filter(u=>e2.test(u)).map(u=>({src:yn(e.id,u),caption:a(u)})),c=r.filter(u=>!e2.test(u));return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"lbl",children:["Attached · ",r.length]}),o.length>0&&t.jsx("div",{className:"thumbs",children:o.map((u,d)=>t.jsx("button",{className:"zoom thumb",onClick:()=>s(d),"aria-label":`Open ${u.caption} full size`,children:t.jsx("img",{src:u.src,alt:u.caption,loading:"lazy"})},u.src))}),c.map(u=>t.jsx("a",{className:"filechip mono",href:yn(e.id,u),target:"_blank",rel:"noreferrer",children:a(u)},u)),n!==null&&t.jsx(Gr,{pictures:o,start:n,onClose:()=>s(null)})]})}function kz({t:e}){return e.story?t.jsxs("div",{className:"db",children:[t.jsx(Jc,{t:e}),e.steps&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"lbl",children:"Steps"}),t.jsx(Rb,{t:e})]})]}):t.jsx("div",{className:"db",children:t.jsx("p",{className:"note",children:"The plan is written after the questions are answered."})})}function vz({t:e}){return t.jsx("div",{className:"db",children:t.jsx(qi,{t:e,all:!0})})}function jz({t:e}){return e.gates?t.jsxs("div",{className:"db",children:[t.jsx("div",{className:"lbl",children:"Gates, checked by squad-kit"}),t.jsx(Rm,{t:e}),t.jsx(Xi,{t:e}),t.jsx("div",{className:"lbl",children:"Before and after"}),e.gates.proof==="pass"||e.proof?.some(n=>n.shows)?t.jsx(Im,{t:e}):t.jsx("p",{className:"note",children:"The screens are recorded after all checks pass."})]}):t.jsx("div",{className:"db",children:t.jsx("p",{className:"note",children:"The Tester records the proof after the Builder finishes."})})}function bz({t:e}){const n=$.useMemo(()=>{const s=new Set,r=[...e.activity.map(a=>a.text),...(e.steps??[]).map(a=>a.live??"")];for(const a of r)for(const o of a.matchAll(/[\w./-]+\/[\w.-]+\.\w+/g))s.add(o[0]);return[...s]},[e]);return t.jsxs("div",{className:"db",children:[t.jsx(OA,{t:e}),t.jsx("div",{className:"lbl",children:"Branch"}),t.jsxs("p",{className:"mono",style:{fontSize:13},children:[e.repo?`${e.repo}: `:"",e.branch??`squad/${e.id.toLowerCase()}`]}),e.worktree&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"lbl",children:"The ticket's copy of the code"}),t.jsx("p",{className:"mono",style:{fontSize:12.5,overflowWrap:"anywhere"},children:e.worktree}),t.jsx(ju,{t:e})]}),e.gates?.ran?.length?t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"lbl",children:"The checks that ran"}),t.jsx("div",{className:"feed",children:e.gates.ran.map(s=>t.jsxs("div",{className:"mono",style:{fontSize:12.5,overflowWrap:"anywhere"},children:[s.name,": ",s.command," (",s.failedOnce?"failed once, passed when run again":s.ok?"passed":"failed",")"]},s.name))})]}):null,e.testChange||e.testDecided?t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"lbl",children:"How the tests run"}),t.jsxs("div",{className:"feed",children:[e.testDecided&&t.jsxs("div",{className:"mono",style:{fontSize:12.5,overflowWrap:"anywhere"},children:[e.testDecided.kept==="new"?`Kept the new one: ${e.testDecided.to} (was ${e.testDecided.from})`:`Kept the current one: ${e.testDecided.from} (not ${e.testDecided.to})`,", by ",e.testDecided.by==="you"?"you":"squad-kit",e.testDecided.ran?`. ${e.testDecided.ran}`:""]}),e.testChange&&t.jsxs("div",{className:"mono",style:{fontSize:12.5,overflowWrap:"anywhere"},children:[e.testChange.ask?"Waiting for a choice":"Tried at the next checks",": ",e.testChange.from," or ",e.testChange.to,e.testChange.ran?`. ${e.testChange.ran}`:""]})]})]}):null,e.localSetup&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"lbl",children:"Setting up your own copy"}),t.jsxs("p",{className:"mono",style:{fontSize:12.5,overflowWrap:"anywhere"},children:[e.localSetup.command," in ",e.localSetup.dir," (",e.localSetup.status,")"]})]}),t.jsx("div",{className:"lbl",children:"Files the squad touched"}),n.length?t.jsx("div",{className:"feed",children:n.map(s=>t.jsx("div",{className:"mono",style:{fontSize:12.5},children:s},s))}):t.jsx("p",{className:"note",children:"No files changed yet."}),t.jsx("div",{className:"lbl",children:"In the terminal"}),t.jsxs("div",{className:"pills",children:[t.jsx(se,{text:`squad show ${e.id}`}),t.jsx(se,{text:`squad watch ${e.id}`})]})]})}const wz=[{stage:"tickets",role:"analyst",who:"Analyst"},{stage:"specs",role:"architect",who:"Architect"},{stage:"implement",role:"builder",who:"Builder"},{stage:"test",role:"tester",who:"Tester"},{stage:"review",role:"reviewer",who:"Reviewer"},{stage:"release",role:"release",who:"Release"},{stage:"bugs",role:"triage",who:"Triage"}];function Nz(){const e=Qe(),n=lI(),s=Di({from:"/board"}),r=rn({from:"/board"}),[a,o]=$.useState(null),[c,u]=$.useState(""),[d,p]=$.useState(!1),f=Pe({queryKey:["ticket-draft-current"],queryFn:()=>Ee("/api/v1/tickets/draft/current"),enabled:a!=="new",refetchInterval:C=>C.state.data?.draft?.status==="working"?2e3:3e4}),m={working:"drafting…",done:"draft ready",failed:"draft stopped",cancelled:""}[f.data?.draft?.status??"cancelled"],y=s.view??"all",x=C=>void r({search:S=>({...S,ticket:C})}),k=()=>void r({search:C=>({...C,ticket:void 0})}),v=e.data?.ready?e.data:null,b=$.useMemo(()=>{const C=[...v?.tickets??[],...d?v?.archived??[]:[]],S=c.trim().toLowerCase();return C.filter(P=>y==="bugs"&&P.kind!=="bug"||y==="mine"&&!Wn(P,v?.meta.user?.name)?!1:!S||P.title.toLowerCase().includes(S)||P.id.toLowerCase().includes(S))},[v,c,y,d]);if(e.isLoading)return t.jsx("div",{className:"center",children:"Loading the board…"});if(!v)return t.jsx($z,{});const N=v.tickets.filter(zo);return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"top",children:[t.jsx("h1",{children:"Board"}),t.jsx("div",{className:"seg",role:"tablist",children:["all","mine","bugs"].map(C=>t.jsx("button",{className:y===C?"on":"",onClick:()=>void r({search:S=>({...S,view:C==="all"?void 0:C})}),children:C==="all"?"All tickets":C==="mine"?"Mine":"Bugs"},C))}),t.jsx("span",{className:"grow"}),t.jsxs("label",{className:"search",children:[t.jsx(Ui,{size:15}),t.jsx("input",{value:c,onChange:C=>u(C.target.value),placeholder:"Search tickets","aria-label":"Search tickets"})]}),t.jsx(Cz,{onPull:()=>o("pull")}),t.jsxs("button",{className:"btn pri",onClick:()=>o("new"),children:[t.jsx(Tt,{size:15})," New ticket",m&&t.jsx("span",{className:"btn-tag",children:m})]})]}),(n||N.length===0)&&t.jsxs("section",{className:"waiting","aria-label":"Waiting for you",children:[t.jsxs("div",{className:"wh",children:[t.jsx("h2",{children:"Waiting for you"}),t.jsx("span",{className:"grow"}),t.jsx(se,{text:"squad inbox"})]}),n?t.jsx(ub,{}):v.meta.engine==="live"&&v.tickets.length===0?t.jsxs("div",{className:"calmlane",children:[t.jsx("span",{className:"glyph",children:t.jsx(Tt,{size:14,strokeWidth:2.5})}),t.jsxs("span",{children:[t.jsx("b",{children:"Start with your first ticket."})," Write what you want in plain words. The squad asks what it needs to know."]}),t.jsx("span",{className:"grow",style:{flex:1}}),t.jsxs("button",{className:"btn pri sm",onClick:()=>o("new"),children:[t.jsx(Tt,{size:14})," New ticket"]})]}):t.jsxs("div",{className:"calmlane",children:[t.jsx("span",{className:"glyph",children:t.jsx(xe,{size:14,strokeWidth:2.5})}),t.jsxs("span",{children:[t.jsx("b",{children:"Nothing needs you right now."})," The squad is working. New questions and approvals show up at the top of every page."]})]})]}),t.jsx("div",{className:"board",children:wz.map(C=>{const S=b.filter(P=>P.stage===C.stage);return t.jsxs("section",{className:"lane","aria-label":As[C.stage],children:[t.jsxs("div",{className:"lh",children:[t.jsx(Hr,{role:C.role}),t.jsxs("span",{className:"t",children:[t.jsx("b",{children:As[C.stage]}),t.jsx("small",{children:C.who})]}),t.jsx("span",{className:"n",children:S.length})]}),S.map(P=>t.jsx(Sz,{t:P,selected:s.ticket===P.id,onOpen:()=>x(P.id)},P.id)),S.length===0&&t.jsx("div",{className:"empty-lane",children:"Nothing here"})]},C.stage)})}),t.jsxs("div",{className:"foot",children:[t.jsxs("span",{children:["Last 30 days ",t.jsxs("b",{children:[v.stats.released30," tickets released"]})]}),t.jsxs("span",{children:[t.jsx("b",{children:v.stats.bugs30})," ",v.stats.bugs30===1?"bug":"bugs"," found after release"]}),t.jsxs("span",{children:[t.jsx("b",{children:v.stats.open})," open tickets"]}),t.jsx(FR,{}),t.jsx("span",{className:"grow"}),(v.archived?.length??0)>0&&t.jsx("button",{className:"btn sm quiet",title:"squad board --archived",onClick:()=>p(!d),children:d?"Hide archived":`Show archived (${v.archived.length})`}),t.jsx("button",{className:"btn sm quiet",onClick:()=>o("bug"),children:"Report a bug"})]}),s.ticket&&t.jsx(Ab,{id:s.ticket,onClose:k}),a==="new"&&t.jsx(Nj,{onClose:()=>o(null),onCreated:C=>x(C.id)}),a==="pull"&&t.jsx(KA,{onClose:()=>o(null),onCreated:C=>x(C.id)}),a==="bug"&&t.jsx(cm,{onClose:()=>o(null)})]})}function Sz({t:e,selected:n,onOpen:s}){const r=!!e.waiting||e.quiet?.kind==="stuck"||Es(e)||ds(e),a=Gi();return t.jsxs("button",{className:`card ${r?"you":""} ${e.kind==="bug"?"bug":""} ${n?"sel":""}`,onClick:s,children:[t.jsxs("div",{className:"row1",children:[t.jsx("span",{className:"id",children:e.id}),e.track==="express"&&t.jsx("span",{className:"prio express",children:"Express"}),t.jsx(tR,{t:e}),r?t.jsx("span",{className:"youtag",children:"You"}):e.kind==="bug"?t.jsx("span",{className:"prio",children:"Bug"}):e.priority==="high"?t.jsx("span",{className:"prio",children:"High"}):null,a&&!Wn(e,a)&&t.jsx("span",{className:"prio owner",title:"Their squad works on it",children:Uo(e)}),e.archived&&t.jsx("span",{className:"prio owner",children:"Archived"}),e.gates?.checks==="unchecked"&&t.jsx("span",{className:"prio unchecked",title:Cm,children:"Not checked"}),t.jsx(GI,{t:e})]}),t.jsx("h4",{children:e.title}),t.jsx(nR,{t:e}),fb(e)&&!r?t.jsx(TI,{t:e}):t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"st",children:[e.live&&!r?t.jsx("span",{className:"live"}):e.stage==="release"?t.jsx(xe,{size:13,strokeWidth:2.5}):null,t.jsx("span",{children:e.quiet?e.quiet.kind==="stuck"?`Looks stuck: ${e.quiet.command??"no progress"}`:`Taking long: ${e.quiet.command??e.status}`:e.status})]}),typeof e.progress=="number"&&!r&&t.jsx("div",{className:"bar",children:t.jsx("i",{style:{width:`${e.progress}%`}})})]})]})}function Cz({onPull:e}){const s=Pe({queryKey:["tracker"],queryFn:()=>Ee("/api/v1/tracker"),refetchInterval:6e4}).data;return s?s.type==="none"?t.jsxs(Te,{to:"/settings",className:"btn",children:[t.jsx(ls,{size:15})," Connect a tracker"]}):t.jsxs("button",{className:"btn",onClick:e,children:[t.jsx(ls,{size:15})," Pull from ",s.label??"the tracker"]}):null}function $z(){return t.jsx("div",{className:"center",children:t.jsxs("div",{children:[t.jsx("h2",{children:"No board yet"}),t.jsx("p",{children:"Run this in the terminal to open a sample board where the squad works on its own:"}),t.jsx("p",{style:{marginTop:12},children:t.jsx(se,{text:"squad demo"})})]})})}function Ez(){const{id:e}=iu({from:"/tickets/$id/proof"}),n=Ro(e),[s,r]=$.useState(0),[a,o]=$.useState(null),c=n.data;if(!c)return t.jsx("div",{className:"center",children:n.isError?`No ticket ${e}.`:"Loading…"});const u=c.proof??[],d=u[Math.min(s,u.length-1)],p=c.waiting?.kind==="proof",f=c.gates,{pictures:m,starts:y}=Nb(u,k=>Cs(`/api/v1/proof/${k}`)),x=y[Math.min(s,u.length-1)]??0;return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"top",children:[t.jsxs("span",{className:"crumbs",children:[t.jsx(Te,{to:"/inbox",children:"Waiting for you"})," /",t.jsxs(Te,{to:"/board",search:{ticket:c.id},children:[c.id," ",c.title]})," ","/ ",t.jsx("b",{children:"Proof"})]}),t.jsx("span",{className:"grow"}),t.jsx(Eb,{t:c})]}),t.jsxs("div",{className:`gatebar ${f?.checks==="unchecked"?"unchecked":""}`,children:[t.jsx(Fr,{state:f?.checks,text:vb(f)}),t.jsx(Fr,{state:f?.review,text:f?.review==="skipped"?"Review notes open, you continued":`Review approved${f?.reviewBy?` by ${f.reviewBy}`:""}`}),t.jsx(Fr,{state:f?.proof,text:jb(c)}),t.jsx("span",{style:{marginLeft:6},children:"Nothing ships without these three."})]}),t.jsx(wb,{g:f,className:"gatebar-why"}),t.jsx(Xi,{t:c,className:"gatebar-why"}),t.jsxs("div",{className:"split proofsplit",children:[t.jsxs("div",{className:"critlist",children:[t.jsxs("div",{className:"lbl",style:{marginTop:0},children:["Done when · ",u.length]}),u.map((k,v)=>t.jsxs("button",{className:`crit ${v===s?"on":""}`,onClick:()=>r(v),children:[t.jsx(Sb,{shows:k.shows}),t.jsxs("span",{children:[k.criterion,t.jsx(of,{shows:k.shows}),Yc(k).length>0&&t.jsx("small",{className:"critpage-s",children:Yc(k).join(" · ")})]})]},k.criterion)),u.length===0&&t.jsx("p",{className:"note",children:bb(c)}),t.jsx(lf,{t:c}),Wo(c)&&t.jsx(Pm,{t:c})]}),t.jsx("div",{className:"stage",children:d?t.jsxs(t.Fragment,{children:[t.jsx("h3",{children:d.criterion}),d.shows&&t.jsxs("p",{className:`verdictline ${$m(d.shows)}`,children:[t.jsx(of,{shows:d.shows}),d.shows!=="met"&&bo(d)&&t.jsx("span",{children:bo(d)})]}),Br(d)&&t.jsxs("p",{className:"critpage",children:["Page ",t.jsx("code",{children:Br(d)})]}),t.jsxs("div",{className:"ba",children:[t.jsxs("div",{children:[t.jsx("div",{className:"cap",children:t.jsx("span",{children:d.beforeLabel})}),t.jsx("button",{className:"zoom",onClick:()=>o(x),"aria-label":`Open ${d.beforeLabel} full size`,children:t.jsx("img",{src:Cs(`/api/v1/proof/${d.before}`),alt:`${d.criterion}, ${d.beforeLabel}`})})]}),t.jsxs("div",{children:[t.jsx("div",{className:"cap",children:t.jsx("span",{children:d.afterLabel})}),t.jsx("button",{className:"zoom",onClick:()=>o(x+1),"aria-label":`Open ${d.afterLabel} full size`,children:t.jsx("img",{src:Cs(`/api/v1/proof/${d.after}`),alt:`${d.criterion}, ${d.afterLabel}`})})]})]}),d.note&&t.jsx("p",{className:"note",children:d.note}),t.jsx(Cb,{shot:d,first:x+2,onOpen:o})]}):t.jsx("p",{className:"note",children:"Nothing to compare."})})]}),a!==null&&t.jsx(Gr,{pictures:m,start:a,onClose:()=>o(null)}),p?t.jsx(Pb,{t:c,sticky:!0}):t.jsx("div",{className:"stickybar",children:t.jsx("span",{className:"note",children:c.status})})]})}function Tz(){const e=a8(),n=Qe(),[s,r]=$.useState(null),[a,o]=$.useState(null),c=e.data??[],u=c.find(p=>p.version===s)??c.find(p=>p.status==="draft")??c[0],d=n.data?.ready?n.data.meta.engine==="demo":!1;return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"top",children:[t.jsx("h1",{children:"Releases"}),t.jsx("span",{className:"grow"}),t.jsx(se,{text:"squad release"})]}),t.jsxs("div",{className:"split rel",children:[t.jsx("div",{className:"listcol",children:c.map(p=>t.jsxs("button",{className:`litem ${u?.version===p.version?p.status==="draft"?"on":"on plain":""}`,onClick:()=>r(p.version),children:[t.jsxs("b",{children:[p.version,p.status==="draft"?t.jsx("span",{className:"youtag",children:p.items.length?"Ready":"Empty"}):p.bugs?.length?t.jsxs("span",{className:"prio",children:[p.bugs.length," ",p.bugs.length===1?"bug":"bugs"]}):null]}),p.status==="draft"?"Next release":p.unpushed?.length?"Not pushed yet":Rs(p.date)," · ",p.items.length," ",p.items.length===1?"ticket":"tickets"]},p.version))}),u?t.jsx(Az,{r:u,onReleased:o,live:!d}):t.jsx("div",{className:"center",children:"No releases yet."})]}),a&&t.jsx(YA,{release:a,demo:d,onClose:()=>o(null)})]})}function Az({r:e,onReleased:n,live:s}){const r=pe(),a=Qe(),o=S=>(a.data?.ready?a.data.tickets.find(P=>P.id===S)?.title:void 0)??e.titles?.[S]??S,[c,u]=$.useState(!1),[d,p]=$.useState(e.notes),[f,m]=$.useState(!1),[y,x]=$.useState(!1),[k,v]=$.useState(!1);$.useEffect(()=>{c||p(e.notes)},[e.notes,c]);const b=e.status==="draft",N=e.unpushed??[],C=e.version.endsWith(".0")?"New features, nothing breaks for users.":"Fixes only, nothing new to learn.";return t.jsxs("div",{className:"detail",children:[t.jsx("h2",{style:{fontSize:24,fontStretch:"88%"},children:b?`Release ${e.version}`:e.version}),t.jsx("p",{className:"note",style:{marginTop:2},children:b?"The squad prepared this release. Read it, edit the notes if you like, then release.":`Released ${Rs(e.date)}`}),N.length>0&&t.jsxs("div",{className:"box",style:{marginTop:10,color:"var(--you-ink)"},children:[t.jsx("b",{children:"Not pushed yet."})," The release is made on this computer, but it did not reach your team's shared copy of the code, so its tickets stay open.",N.map(S=>t.jsxs("div",{style:{marginTop:6},children:[S.plain??"An engineer can see why below.",t.jsxs("details",{style:{marginTop:4},children:[t.jsx("summary",{className:"note",children:"For engineers"}),t.jsxs("div",{className:"mono",style:{fontSize:12.5,marginTop:4},children:[S.repo==="."?"project":S.repo,": ",S.base," → ",S.remote,": ",S.error]})]})]},S.repo)),t.jsxs("div",{style:{display:"flex",gap:10,alignItems:"center",marginTop:10},children:[t.jsxs("button",{className:"btn pri",disabled:r.isPending,onClick:()=>r.mutate({path:`/api/v1/releases/${e.version}/push`},{onSuccess:S=>S.unpushed?.length?void 0:n(S)}),children:[t.jsx(Va,{size:15})," Push again"]}),t.jsx("button",{className:"btn quiet",disabled:r.isPending,title:"An engineer brought it in by hand, so Push again cannot see it. You say how; its tickets close.",onClick:()=>v(!0),children:"It reached it another way"}),t.jsx("span",{className:"grow"}),t.jsx(se,{text:`squad release ${e.version} --push-again`})]})]}),b&&e.log&&e.log.length>0&&t.jsxs("div",{className:"box",style:{marginTop:10},children:[t.jsx("b",{children:"Last time it did not go out."}),e.log.map(S=>t.jsxs("div",{className:"checkrow",style:S.ok?void 0:{color:"var(--you-ink)"},children:[t.jsx("span",{className:`cbx ${S.ok?"on":""}`,children:S.ok?t.jsx(xe,{size:11,strokeWidth:3}):"!"}),S.text]},S.text))]}),t.jsx("div",{className:"lbl",children:"What's inside"}),e.items.map(S=>t.jsxs("div",{className:"trow",children:[t.jsx("span",{className:"mono",children:S.id}),t.jsx("b",{children:S.title}),t.jsxs("span",{style:{display:"flex",gap:8,alignItems:"center",justifyContent:"flex-end",flexWrap:"wrap"},children:[S.gates?.checks==="unchecked"?t.jsx(Fr,{state:"unchecked",text:"Not checked · review, proof"}):S.gates&&t.jsxs("span",{className:"pill ok",children:[t.jsx(xe,{size:13,strokeWidth:2.5})," Checks, review, proof"]}),b&&e.items.length>1&&t.jsx("button",{className:"btn sm quiet",title:`squad release --without ${S.id}`,disabled:r.isPending,onClick:()=>r.mutate({path:`/api/v1/releases/${e.version}/take-out`,body:{ticket:S.id},done:`${S.id} goes out with the next release`}),children:"Take out"})]})]},S.id)),e.items.length===0&&t.jsx("p",{className:"note",children:"No tickets yet. Tickets join after you check their proof."}),b&&e.items.length>1&&t.jsx("div",{style:{marginTop:2},children:t.jsx(se,{text:`squad release --without ${e.items[e.items.length-1].id}`})}),(e.out?.length??0)>0&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"lbl",children:b?"Taken out of this release":"Left out of this release"}),e.out.map(S=>t.jsxs("div",{className:"trow",children:[t.jsx("span",{className:"mono",children:S}),t.jsx("b",{children:o(S)}),b?t.jsxs("button",{className:"btn sm",disabled:r.isPending,onClick:()=>r.mutate({path:`/api/v1/releases/${e.version}/put-back`,body:{ticket:S},done:`${S} is back in ${e.version}`}),children:[t.jsx(e8,{size:13})," Put back"]}):t.jsx("span",{className:"note",children:"Goes out with the next release"})]},S)),b&&t.jsx("p",{className:"note",children:"Its code stays in main. This release leaves it out, and it goes out with the next one."}),b&&t.jsx("div",{style:{marginTop:6},children:t.jsx(se,{text:`squad release --put-back ${e.out[0]}`})})]}),!b&&e.bugs&&e.bugs.length>0&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"lbl",children:"Bugs found after this release"}),e.bugs.map(S=>t.jsxs("div",{className:"trow",children:[t.jsx("span",{className:"mono",children:S}),t.jsx(Te,{to:"/board",search:{ticket:S},children:t.jsx("b",{children:"Open the bug"})}),t.jsx("span",{})]},S))]}),t.jsxs("div",{className:"grid2",children:[t.jsxs("div",{children:[t.jsx("div",{className:"lbl",children:"Version"}),t.jsxs("div",{className:"ver",children:[t.jsx("span",{className:"from",children:e.from.replace(/^v/,"")}),t.jsx(lo,{size:20}),t.jsx("span",{children:e.version.replace(/^v/,"")})]}),t.jsx("p",{className:"note",style:{marginTop:4},children:C}),t.jsx("div",{className:"lbl",children:b||!e.log?"Also":"What the release did"}),!b&&e.log?e.log.map(S=>t.jsxs("div",{className:"checkrow",style:S.ok?void 0:{color:"var(--you-ink)"},children:[t.jsx("span",{className:`cbx ${S.ok?"on":""}`,children:S.ok?t.jsx(xe,{size:11,strokeWidth:3}):"!"}),S.text]},S.text)):[["changelog","Update the changelog"],["tag",`Tag ${e.version} in git`],["pipeline","Run the pipeline"],["whatsapp","Draft a WhatsApp note for my manager"]].map(([S,P])=>t.jsxs("div",{className:"checkrow",children:[t.jsx("span",{className:`cbx ${e.addons[S]?"on":""}`,children:e.addons[S]&&t.jsx(xe,{size:11,strokeWidth:3})}),P]},S))]}),t.jsxs("div",{children:[t.jsxs("div",{className:"lbl",children:["Release notes",b&&", written by the squad",t.jsx("span",{className:"grow",style:{flex:1}}),b&&!c&&t.jsxs("button",{className:"btn sm",onClick:()=>u(!0),children:[t.jsx(co,{size:13})," Edit"]})]}),c?t.jsxs(t.Fragment,{children:[t.jsx("textarea",{className:"textarea mono",style:{minHeight:180,fontSize:13},value:d,onChange:S=>p(S.target.value)}),t.jsxs("div",{style:{display:"flex",gap:8,marginTop:8},children:[t.jsx("button",{className:"btn sm pri",onClick:()=>r.mutate({path:`/api/v1/releases/${e.version}/notes`,method:"PUT",body:{notes:d},done:"Notes saved"},{onSuccess:()=>u(!1)}),children:"Save notes"}),t.jsx("button",{className:"btn sm",onClick:()=>u(!1),children:"Cancel"})]})]}):t.jsx(f8,{notes:e.notes})]})]}),t.jsx("div",{style:{display:"flex",gap:10,alignItems:"center",marginTop:26},children:b?t.jsxs(t.Fragment,{children:[t.jsxs("button",{className:"btn pri",disabled:e.items.length===0,onClick:()=>m(!0),children:[t.jsx(Va,{size:15})," Release ",e.version]}),t.jsx("span",{className:"note",children:"You'll be asked once to confirm."})]}):t.jsxs("button",{className:"btn",onClick:()=>x(!0),children:["Report a bug in ",e.version]})}),f&&t.jsxs(Ve,{title:`Release ${e.version}?`,onClose:()=>m(!1),icon:t.jsx("span",{className:"glyph",children:t.jsx(Va,{size:15})}),footer:t.jsxs(t.Fragment,{children:[t.jsxs("button",{className:"btn pri",disabled:r.isPending,onClick:()=>r.mutate({path:`/api/v1/releases/${e.version}/release`},{onSuccess:S=>{m(!1),n(S)}}),children:[t.jsx(Va,{size:15})," Yes, release it"]}),t.jsx("button",{className:"btn",onClick:()=>m(!1),children:"Not yet"}),t.jsx("span",{className:"grow"}),t.jsx(se,{text:`squad release ${e.version}`})]}),children:[t.jsxs("p",{children:[e.items.length," tickets go live: ",e.items.map(S=>S.title).join(", "),"."]}),e.targets.length>0&&t.jsxs("div",{className:"box",style:{marginBottom:6},children:[t.jsx("b",{children:"This release changes these branches:"}),e.targets.map(S=>t.jsxs("div",{className:"mono",style:{fontSize:12.5,marginTop:6},children:[S.repo==="."?"project":S.repo,": ",S.branch," ",S.remote?`→ pushed to ${S.remote}`:"(no remote, stays on this Mac)"]},S.repo)),t.jsx("p",{className:"note",style:{marginTop:6},children:"Change the branch or remote in Settings first if this is not right."})]})]}),!b&&s&&t.jsx(Pz,{}),y&&t.jsx(cm,{foundIn:e.version,onClose:()=>x(!1)}),k&&t.jsx(Rz,{version:e.version,onClose:()=>v(!1),onDone:n})]})}function Pz(){const e=pe(),s=Pe({queryKey:["branches"],queryFn:()=>Ee("/api/v1/branches"),refetchInterval:3e4}).data;return!s||!s.here.length&&!s.remote.length?null:t.jsxs("div",{className:"box",style:{marginTop:18},children:[t.jsxs("b",{children:[t.jsx(Tp,{size:14})," Old ticket branches"]}),t.jsxs("p",{className:"note",style:{margin:"4px 0 8px"},children:[[s.here.length?`${s.here.length} on this computer`:"",s.remote.length?`${s.remote.length} in your team's shared copy of the code`:""].filter(Boolean).join(" and "),", from released tickets. Their work is in main, so nothing is lost."]}),t.jsxs("div",{style:{display:"flex",gap:10,alignItems:"center",flexWrap:"wrap"},children:[s.here.length>0&&t.jsx("button",{className:"btn sm",disabled:e.isPending,onClick:()=>e.mutate({path:"/api/v1/branches/clean",body:{remote:!1},done:"Deleted the old branches on this computer"}),children:"Delete them here"}),s.remote.length>0&&t.jsxs("button",{className:"btn sm",disabled:e.isPending,onClick:()=>e.mutate({path:"/api/v1/branches/clean",body:{remote:!0},done:"Deleted the old branches here and in the shared copy of the code"}),children:["Delete them ",s.here.length?"here and ":"","in the shared copy"]}),t.jsx("span",{className:"grow",style:{flex:1}}),t.jsx(se,{text:s.remote.length?"squad branches --clean --remote":"squad branches --clean"})]})]})}function Rz({version:e,onClose:n,onDone:s}){const r=zn(),{toast:a}=qe(),[o,c]=$.useState(""),[u,d]=$.useState(null),[p,f]=$.useState(!1),m=async y=>{f(!0);try{const x=await bt(`/api/v1/releases/${e}/mark-sent`,"POST",{reason:o,...y?{anyway:y}:{}});r.invalidateQueries(),s(x),n()}catch(x){x instanceof ou&&x.status===409?d(x.message):a(x instanceof Error?x.message:String(x),"err")}finally{f(!1)}};return t.jsxs(Ve,{title:"It reached it another way",onClose:n,footer:t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"grow"}),t.jsx("button",{className:"btn",onClick:n,children:"Cancel"}),u?t.jsx("button",{className:"btn pri",disabled:p||!o.trim(),onClick:()=>void m(!0),children:"Mark it anyway"}):t.jsx("button",{className:"btn pri",disabled:p||!o.trim(),onClick:()=>void m(!1),children:p?"Looking for it…":"Mark it as sent"})]}),children:[t.jsxs("p",{className:"note",children:[e,"'s tickets close, and nothing checks after this. squad-kit looks in your team's shared copy of the code first."]}),t.jsx("div",{className:"lbl",children:"How did it get there?"}),t.jsx("textarea",{className:"waynote",rows:2,value:o,onChange:y=>c(y.target.value),placeholder:"For example: Sara merged it by hand"}),u&&t.jsx("div",{className:"box",style:{marginTop:10},children:u}),t.jsx("div",{style:{marginTop:10},children:t.jsx(se,{text:`squad release ${e} --mark-sent --reason ${Le(o.trim()||"how it got there")}${u?" --anyway":""}`})})]})}function Iz(){const[e,n]=$.useState(void 0),s=Pe({queryKey:["backlog",e??""],queryFn:()=>Ee(`/api/v1/backlog${e?`?sprint=${encodeURIComponent(e)}`:""}`),refetchInterval:15e3}),r=s.data,a=e??r?.sprint,o=r?.sprints.find(c=>c.path===a)?.name;return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"top",children:[t.jsx("h1",{children:"Backlog"}),r?.connected&&r.sprints.length>0&&t.jsxs("select",{className:"input",style:{width:"auto",marginLeft:12},value:a??"all",onChange:c=>n(c.target.value),"aria-label":"Sprint",children:[r.sprints.map(c=>t.jsxs("option",{value:c.path,children:[c.name,c.current?" (now)":""]},c.path)),t.jsx("option",{value:"all",children:"Everything open"})]}),t.jsx("span",{className:"grow"}),t.jsx(se,{text:o?`squad backlog --sprint ${Le(o)}`:"squad backlog"})]}),t.jsx("div",{className:"scroll",children:t.jsx("div",{className:"page",children:s.isLoading?t.jsx("p",{className:"note",children:"Reading the backlog from Azure…"}):r?.connected?r.error?t.jsx("p",{className:"note",style:{color:"var(--bug)"},children:r.error}):r.items.length===0?t.jsxs("p",{className:"note",children:["Nothing open in ",o??"this sprint","."]}):t.jsxs(t.Fragment,{children:[t.jsxs("p",{className:"note",style:{marginBottom:12},children:[r.items.length," open ",r.items.length===1?"item":"items"," in ",o??"the backlog",", in backlog order. Start one and the squad picks it up; Azure follows along."]}),t.jsxs("table",{className:"table",children:[t.jsx("thead",{children:t.jsxs("tr",{children:[t.jsx("th",{style:{width:80},children:"ID"}),t.jsx("th",{children:"Title"}),t.jsx("th",{style:{width:70},children:"Points"}),t.jsx("th",{style:{width:100},children:"On Azure"}),t.jsx("th",{style:{width:260},children:"squad-kit"})]})}),t.jsx("tbody",{children:r.items.map(c=>t.jsx(zz,{w:c},c.id))})]})]}):t.jsxs("div",{className:"calm",children:[t.jsx("span",{className:"ring",children:t.jsx(Q6,{size:18})}),t.jsxs("div",{children:[t.jsx("b",{children:"Connect Azure DevOps"}),t.jsxs("span",{children:[r?.error??"Add your Azure organization, project and token, and your stories and bugs show up here."," ",t.jsx(Te,{to:"/settings",style:{fontWeight:600},children:"Open Settings"})]})]})]})})})]})}function zz({w:e}){const n=pe();return t.jsxs("tr",{children:[t.jsx("td",{className:"mono",children:t.jsxs("a",{href:e.url,target:"_blank",rel:"noreferrer",style:{display:"inline-flex",alignItems:"center",gap:4},children:[e.id," ",t.jsx(is,{size:11})]})}),t.jsx("td",{children:t.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:8},children:[e.type==="Bug"&&t.jsxs("span",{className:"pill bug",style:{padding:"2px 8px"},children:[t.jsx(Ts,{size:12})," Bug"]}),t.jsx("span",{style:{fontWeight:600},children:e.title})]})}),t.jsx("td",{children:e.points??""}),t.jsx("td",{children:e.state}),t.jsx("td",{children:e.ticket?t.jsxs(Te,{to:"/board",search:{ticket:e.ticket.id},style:{color:"var(--muted)"},children:[t.jsx("b",{className:"mono",style:{color:"var(--text)"},children:e.ticket.id})," ",e.ticket.stage==="done"?"Released":As[e.ticket.stage]]}):t.jsxs("button",{className:"btn sm pri",disabled:n.isPending,onClick:()=>n.mutate({path:`/api/v1/backlog/${e.id}/start`,done:`${e.ref} is on the board. The Analyst is reading it.`}),children:[t.jsx(Wi,{size:13})," Start"]})})]})}const Eu=["Structure","Data","Security","Interface","Rules"],Mz={nextdotjs:{hex:"000000",path:"M18.665 21.978C16.758 23.255 14.465 24 12 24 5.377 24 0 18.623 0 12S5.377 0 12 0s12 5.377 12 12c0 3.583-1.574 6.801-4.067 9.001L9.219 7.2H7.2v9.596h1.615V9.251l9.85 12.727Zm-3.332-8.533 1.6 2.061V7.2h-1.6v6.245Z"},react:{hex:"61DAFB",path:"M14.23 12.004a2.236 2.236 0 0 1-2.235 2.236 2.236 2.236 0 0 1-2.236-2.236 2.236 2.236 0 0 1 2.235-2.236 2.236 2.236 0 0 1 2.236 2.236zm2.648-10.69c-1.346 0-3.107.96-4.888 2.622-1.78-1.653-3.542-2.602-4.887-2.602-.41 0-.783.093-1.106.278-1.375.793-1.683 3.264-.973 6.365C1.98 8.917 0 10.42 0 12.004c0 1.59 1.99 3.097 5.043 4.03-.704 3.113-.39 5.588.988 6.38.32.187.69.275 1.102.275 1.345 0 3.107-.96 4.888-2.624 1.78 1.654 3.542 2.603 4.887 2.603.41 0 .783-.09 1.106-.275 1.374-.792 1.683-3.263.973-6.365C22.02 15.096 24 13.59 24 12.004c0-1.59-1.99-3.097-5.043-4.032.704-3.11.39-5.587-.988-6.38-.318-.184-.688-.277-1.092-.278zm-.005 1.09v.006c.225 0 .406.044.558.127.666.382.955 1.835.73 3.704-.054.46-.142.945-.25 1.44-.96-.236-2.006-.417-3.107-.534-.66-.905-1.345-1.727-2.035-2.447 1.592-1.48 3.087-2.292 4.105-2.295zm-9.77.02c1.012 0 2.514.808 4.11 2.28-.686.72-1.37 1.537-2.02 2.442-1.107.117-2.154.298-3.113.538-.112-.49-.195-.964-.254-1.42-.23-1.868.054-3.32.714-3.707.19-.09.4-.127.563-.132zm4.882 3.05c.455.468.91.992 1.36 1.564-.44-.02-.89-.034-1.345-.034-.46 0-.915.01-1.36.034.44-.572.895-1.096 1.345-1.565zM12 8.1c.74 0 1.477.034 2.202.093.406.582.802 1.203 1.183 1.86.372.64.71 1.29 1.018 1.946-.308.655-.646 1.31-1.013 1.95-.38.66-.773 1.288-1.18 1.87-.728.063-1.466.098-2.21.098-.74 0-1.477-.035-2.202-.093-.406-.582-.802-1.204-1.183-1.86-.372-.64-.71-1.29-1.018-1.946.303-.657.646-1.313 1.013-1.954.38-.66.773-1.286 1.18-1.868.728-.064 1.466-.098 2.21-.098zm-3.635.254c-.24.377-.48.763-.704 1.16-.225.39-.435.782-.635 1.174-.265-.656-.49-1.31-.676-1.947.64-.15 1.315-.283 2.015-.386zm7.26 0c.695.103 1.365.23 2.006.387-.18.632-.405 1.282-.66 1.933-.2-.39-.41-.783-.64-1.174-.225-.392-.465-.774-.705-1.146zm3.063.675c.484.15.944.317 1.375.498 1.732.74 2.852 1.708 2.852 2.476-.005.768-1.125 1.74-2.857 2.475-.42.18-.88.342-1.355.493-.28-.958-.646-1.956-1.1-2.98.45-1.017.81-2.01 1.085-2.964zm-13.395.004c.278.96.645 1.957 1.1 2.98-.45 1.017-.812 2.01-1.086 2.964-.484-.15-.944-.318-1.37-.5-1.732-.737-2.852-1.706-2.852-2.474 0-.768 1.12-1.742 2.852-2.476.42-.18.88-.342 1.356-.494zm11.678 4.28c.265.657.49 1.312.676 1.948-.64.157-1.316.29-2.016.39.24-.375.48-.762.705-1.158.225-.39.435-.788.636-1.18zm-9.945.02c.2.392.41.783.64 1.175.23.39.465.772.705 1.143-.695-.102-1.365-.23-2.006-.386.18-.63.406-1.282.66-1.933zM17.92 16.32c.112.493.2.968.254 1.423.23 1.868-.054 3.32-.714 3.708-.147.09-.338.128-.563.128-1.012 0-2.514-.807-4.11-2.28.686-.72 1.37-1.536 2.02-2.44 1.107-.118 2.154-.3 3.113-.54zm-11.83.01c.96.234 2.006.415 3.107.532.66.905 1.345 1.727 2.035 2.446-1.595 1.483-3.092 2.295-4.11 2.295-.22-.005-.406-.05-.553-.132-.666-.38-.955-1.834-.73-3.703.054-.46.142-.944.25-1.438zm4.56.64c.44.02.89.034 1.345.034.46 0 .915-.01 1.36-.034-.44.572-.895 1.095-1.345 1.565-.455-.47-.91-.993-1.36-1.565z"},typescript:{hex:"3178C6",path:"M1.125 0C.502 0 0 .502 0 1.125v21.75C0 23.498.502 24 1.125 24h21.75c.623 0 1.125-.502 1.125-1.125V1.125C24 .502 23.498 0 22.875 0zm17.363 9.75c.612 0 1.154.037 1.627.111a6.38 6.38 0 0 1 1.306.34v2.458a3.95 3.95 0 0 0-.643-.361 5.093 5.093 0 0 0-.717-.26 5.453 5.453 0 0 0-1.426-.2c-.3 0-.573.028-.819.086a2.1 2.1 0 0 0-.623.242c-.17.104-.3.229-.393.374a.888.888 0 0 0-.14.49c0 .196.053.373.156.529.104.156.252.304.443.444s.423.276.696.41c.273.135.582.274.926.416.47.197.892.407 1.266.628.374.222.695.473.963.753.268.279.472.598.614.957.142.359.214.776.214 1.253 0 .657-.125 1.21-.373 1.656a3.033 3.033 0 0 1-1.012 1.085 4.38 4.38 0 0 1-1.487.596c-.566.12-1.163.18-1.79.18a9.916 9.916 0 0 1-1.84-.164 5.544 5.544 0 0 1-1.512-.493v-2.63a5.033 5.033 0 0 0 3.237 1.2c.333 0 .624-.03.872-.09.249-.06.456-.144.623-.25.166-.108.29-.234.373-.38a1.023 1.023 0 0 0-.074-1.089 2.12 2.12 0 0 0-.537-.5 5.597 5.597 0 0 0-.807-.444 27.72 27.72 0 0 0-1.007-.436c-.918-.383-1.602-.852-2.053-1.405-.45-.553-.676-1.222-.676-2.005 0-.614.123-1.141.369-1.582.246-.441.58-.804 1.004-1.089a4.494 4.494 0 0 1 1.47-.629 7.536 7.536 0 0 1 1.77-.201zm-15.113.188h9.563v2.166H9.506v9.646H6.789v-9.646H3.375z"},javascript:{hex:"F7DF1E",path:"M0 0h24v24H0V0zm22.034 18.276c-.175-1.095-.888-2.015-3.003-2.873-.736-.345-1.554-.585-1.797-1.14-.091-.33-.105-.51-.046-.705.15-.646.915-.84 1.515-.66.39.12.75.42.976.9 1.034-.676 1.034-.676 1.755-1.125-.27-.42-.404-.601-.586-.78-.63-.705-1.469-1.065-2.834-1.034l-.705.089c-.676.165-1.32.525-1.71 1.005-1.14 1.291-.811 3.541.569 4.471 1.365 1.02 3.361 1.244 3.616 2.205.24 1.17-.87 1.545-1.966 1.41-.811-.18-1.26-.586-1.755-1.336l-1.83 1.051c.21.48.45.689.81 1.109 1.74 1.756 6.09 1.666 6.871-1.004.029-.09.24-.705.074-1.65l.046.067zm-8.983-7.245h-2.248c0 1.938-.009 3.864-.009 5.805 0 1.232.063 2.363-.138 2.711-.33.689-1.18.601-1.566.48-.396-.196-.597-.466-.83-.855-.063-.105-.11-.196-.127-.196l-1.825 1.125c.305.63.75 1.172 1.324 1.517.855.51 2.004.675 3.207.405.783-.226 1.458-.691 1.811-1.411.51-.93.402-2.07.397-3.346.012-2.054 0-4.109 0-6.179l.004-.056z"},prisma:{hex:"2D3748",path:"M21.8068 18.2848L13.5528.7565c-.207-.4382-.639-.7273-1.1286-.7541-.5023-.0293-.9523.213-1.2062.6253L2.266 15.1271c-.2773.4518-.2718 1.0091.0158 1.4555l4.3759 6.7786c.2608.4046.7127.6388 1.1823.6388.1332 0 .267-.0188.3987-.0577l12.7019-3.7568c.3891-.1151.7072-.3904.8737-.7553s.1633-.7828-.0075-1.1454zm-1.8481.7519L9.1814 22.2242c-.3292.0975-.6448-.1873-.5756-.5194l3.8501-18.4386c.072-.3448.5486-.3996.699-.0803l7.1288 15.138c.1344.2856-.019.6224-.325.7128z"},sqlite:{hex:"003B57",path:"M21.678.521c-1.032-.92-2.28-.55-3.513.544a8.71 8.71 0 0 0-.547.535c-2.109 2.237-4.066 6.38-4.674 9.544.237.48.422 1.093.544 1.561a13.044 13.044 0 0 1 .164.703s-.019-.071-.096-.296l-.05-.146a1.689 1.689 0 0 0-.033-.08c-.138-.32-.518-.995-.686-1.289-.143.423-.27.818-.376 1.176.484.884.778 2.4.778 2.4s-.025-.099-.147-.442c-.107-.303-.644-1.244-.772-1.464-.217.804-.304 1.346-.226 1.478.152.256.296.698.422 1.186.286 1.1.485 2.44.485 2.44l.017.224a22.41 22.41 0 0 0 .056 2.748c.095 1.146.273 2.13.5 2.657l.155-.084c-.334-1.038-.47-2.399-.41-3.967.09-2.398.642-5.29 1.661-8.304 1.723-4.55 4.113-8.201 6.3-9.945-1.993 1.8-4.692 7.63-5.5 9.788-.904 2.416-1.545 4.684-1.931 6.857.666-2.037 2.821-2.912 2.821-2.912s1.057-1.304 2.292-3.166c-.74.169-1.955.458-2.362.629-.6.251-.762.337-.762.337s1.945-1.184 3.613-1.72C21.695 7.9 24.195 2.767 21.678.521m-18.573.543A1.842 1.842 0 0 0 1.27 2.9v16.608a1.84 1.84 0 0 0 1.835 1.834h9.418a22.953 22.953 0 0 1-.052-2.707c-.006-.062-.011-.141-.016-.2a27.01 27.01 0 0 0-.473-2.378c-.121-.47-.275-.898-.369-1.057-.116-.197-.098-.31-.097-.432 0-.12.015-.245.037-.386a9.98 9.98 0 0 1 .234-1.045l.217-.028c-.017-.035-.014-.065-.031-.097l-.041-.381a32.8 32.8 0 0 1 .382-1.194l.2-.019c-.008-.016-.01-.038-.018-.053l-.043-.316c.63-3.28 2.587-7.443 4.8-9.791.066-.069.133-.128.198-.194Z"},vitest:{hex:"6E9F18",path:"M13.74024 1.05293a.49504.49504 0 0 0-.1569.02512.49338.49338 0 0 0-.25056.1876L7.59513 9.56159a.4895.4895 0 0 0-.08373.22327.48846.48846 0 0 0 .03163.23629.4893.4893 0 0 0 .13985.19319.4927.4927 0 0 0 .2149.10481l3.70685.78609-.22947 4.58007a.48834.48834 0 0 0 .08466.30017.49205.49205 0 0 0 .24931.18854c.10157.03398.21174.03444.3135.00064a.49387.49387 0 0 0 .25056-.18761l5.73735-8.29594a.4884.4884 0 0 0 .08404-.22327c.009-.08015-.0016-.16137-.03163-.23629a.48835.48835 0 0 0-.13985-.19319.49318.49318 0 0 0-.2149-.1048l-3.70686-.7861.22947-4.58008a.48802.48802 0 0 0-.08466-.30017.4913.4913 0 0 0-.24931-.18853.49439.49439 0 0 0-.1566-.02574zM1.15697 9.78795c-.30647.0012-.60009.12378-.81679.34048a1.16107 1.16107 0 0 0-.34017.81648 1.162 1.162 0 0 0 .33366.81957l10.84241 10.8421a1.15762 1.15762 0 0 0 .37677.25211 1.1583 1.1583 0 0 0 .44467.08838c.00084 0 .0016-.00031.0025-.00031.00073 0 .0014.00031.0022.00031a1.15827 1.15827 0 0 0 .44467-.08838 1.15731 1.15731 0 0 0 .37677-.2521l10.84236-10.8421a1.16272 1.16272 0 0 0 .33397-.81958c-.0013-.30647-.12376-.59976-.34048-.81648a1.1616 1.1616 0 0 0-.81679-.34048 1.16114 1.16114 0 0 0-.81926.33366l-5.4012 5.4009c-.0078.0074-.01718.01255-.02482.02015L12 20.14011l-4.59776-4.59745c-.0074-.0074-.01659-.01238-.02419-.01954l-5.4015-5.40151a1.162 1.162 0 0 0-.81958-.33366Z"},eslint:{hex:"4B32C3",path:"M7.257 9.132L11.816 6.5a.369.369 0 0 1 .368 0l4.559 2.632a.369.369 0 0 1 .184.32v5.263a.37.37 0 0 1-.184.319l-4.559 2.632a.369.369 0 0 1-.368 0l-4.559-2.632a.369.369 0 0 1-.184-.32V9.452a.37.37 0 0 1 .184-.32M23.852 11.53l-5.446-9.475c-.198-.343-.564-.596-.96-.596H6.555c-.396 0-.762.253-.96.596L.149 11.509a1.127 1.127 0 0 0 0 1.117l5.447 9.398c.197.342.563.517.959.517h10.893c.395 0 .76-.17.959-.512l5.446-9.413a1.069 1.069 0 0 0 0-1.086m-4.51 4.556a.4.4 0 0 1-.204.338L12.2 20.426a.395.395 0 0 1-.392 0l-6.943-4.002a.4.4 0 0 1-.205-.338V8.08c0-.14.083-.269.204-.338L11.8 3.74c.12-.07.272-.07.392 0l6.943 4.003a.4.4 0 0 1 .206.338z"},primereact:{hex:"03C4E8",path:"M12.01 0c-1.212 0-2.297.62-2.903 1.66l-1.52 2.608H4.303A3.287 3.287 0 0 0 1.43 5.911a3.226 3.226 0 0 0 0 3.285l1.642 2.819-1.646 2.825a3.202 3.202 0 0 0 0 3.261 3.265 3.265 0 0 0 2.851 1.631h2.925l.865.856L9.09 22.34A3.322 3.322 0 0 0 11.991 24c1.211 0 2.296-.62 2.902-1.66l.816-1.4 1.22-1.208h2.77a3.287 3.287 0 0 0 2.87-1.643c.6-1.028.6-2.256 0-3.285l-1.642-2.82 1.646-2.824a3.202 3.202 0 0 0 0-3.261 3.265 3.265 0 0 0-2.851-1.631H16.43L14.91 1.66A3.322 3.322 0 0 0 12.01 0Zm0 .719c.948 0 1.798.486 2.273 1.3l1.31 2.249H8.425l1.31-2.248A2.603 2.603 0 0 1 12.01.719Zm.33 4.265v7.74h.962l5.904-2.174.014-.057.87 1.492-1.33 2.282.171-3.173-1.51.543-1.51 1.494-1.237-.27.962 1.357v4.212l1.452-1.296-.708 1.216v.001l-.744.622v.654l-.412.708V14.49l-1.098-1.63-.687.407h-2.746l-.687-.407-1.098 1.63v6.101l-.412-.706v-.912l-1.036-.867-.729-1.25 1.765 1.574v-4.212l.961-1.358-1.236.271-1.51-1.494-1.511-.543.188 3.455-1.477-2.534.942-1.617.122-.208.088.36 5.904 2.174h.824V4.985Zm1.512 0h.412l.96 2.17 1.935-.2.237.406-2.452.192zm-3.985.001h.412L9.187 7.552l-2.556-.205.072-.124.001.001.163-.28 2.04.21Zm-5.565.001h2.867L5.831 7.282l-1.592-.127.49 2.018-1.237 2.124-1.433-2.46a2.52 2.52 0 0 1 0-2.567 2.568 2.568 0 0 1 2.243-1.284Zm12.547 0h2.873c.928 0 1.759.476 2.223 1.272a2.497 2.497 0 0 1 0 2.543l-1.437 2.466-1.042-1.789.563-2.323-1.833.143Zm3.659 7.718 1.433 2.46a2.52 2.52 0 0 1 0 2.566 2.567 2.567 0 0 1-2.243 1.283h-2.277V18zm-17.016.03 3.22 5.525v.754H4.277a2.545 2.545 0 0 1-2.223-1.27 2.497 2.497 0 0 1 0-2.544z"},tailwindcss:{hex:"06B6D4",path:"M12.001,4.8c-3.2,0-5.2,1.6-6,4.8c1.2-1.6,2.6-2.2,4.2-1.8c0.913,0.228,1.565,0.89,2.288,1.624 C13.666,10.618,15.027,12,18.001,12c3.2,0,5.2-1.6,6-4.8c-1.2,1.6-2.6,2.2-4.2,1.8c-0.913-0.228-1.565-0.89-2.288-1.624 C16.337,6.182,14.976,4.8,12.001,4.8z M6.001,12c-3.2,0-5.2,1.6-6,4.8c1.2-1.6,2.6-2.2,4.2-1.8c0.913,0.228,1.565,0.89,2.288,1.624 c1.177,1.194,2.538,2.576,5.512,2.576c3.2,0,5.2-1.6,6-4.8c-1.2,1.6-2.6,2.2-4.2,1.8c-0.913-0.228-1.565-0.89-2.288-1.624 C10.337,13.382,8.976,12,6.001,12z"},nodedotjs:{hex:"5FA04E",path:"M11.998,24c-0.321,0-0.641-0.084-0.922-0.247l-2.936-1.737c-0.438-0.245-0.224-0.332-0.08-0.383 c0.585-0.203,0.703-0.25,1.328-0.604c0.065-0.037,0.151-0.023,0.218,0.017l2.256,1.339c0.082,0.045,0.197,0.045,0.272,0l8.795-5.076 c0.082-0.047,0.134-0.141,0.134-0.238V6.921c0-0.099-0.053-0.192-0.137-0.242l-8.791-5.072c-0.081-0.047-0.189-0.047-0.271,0 L3.075,6.68C2.99,6.729,2.936,6.825,2.936,6.921v10.15c0,0.097,0.054,0.189,0.139,0.235l2.409,1.392 c1.307,0.654,2.108-0.116,2.108-0.89V7.787c0-0.142,0.114-0.253,0.256-0.253h1.115c0.139,0,0.255,0.112,0.255,0.253v10.021 c0,1.745-0.95,2.745-2.604,2.745c-0.508,0-0.909,0-2.026-0.551L2.28,18.675c-0.57-0.329-0.922-0.945-0.922-1.604V6.921 c0-0.659,0.353-1.275,0.922-1.603l8.795-5.082c0.557-0.315,1.296-0.315,1.848,0l8.794,5.082c0.57,0.329,0.924,0.944,0.924,1.603 v10.15c0,0.659-0.354,1.273-0.924,1.604l-8.794,5.078C12.643,23.916,12.324,24,11.998,24z M19.099,13.993 c0-1.9-1.284-2.406-3.987-2.763c-2.731-0.361-3.009-0.548-3.009-1.187c0-0.528,0.235-1.233,2.258-1.233 c1.807,0,2.473,0.389,2.747,1.607c0.024,0.115,0.129,0.199,0.247,0.199h1.141c0.071,0,0.138-0.031,0.186-0.081 c0.048-0.054,0.074-0.123,0.067-0.196c-0.177-2.098-1.571-3.076-4.388-3.076c-2.508,0-4.004,1.058-4.004,2.833 c0,1.925,1.488,2.457,3.895,2.695c2.88,0.282,3.103,0.703,3.103,1.269c0,0.983-0.789,1.402-2.642,1.402 c-2.327,0-2.839-0.584-3.011-1.742c-0.02-0.124-0.126-0.215-0.253-0.215h-1.137c-0.141,0-0.254,0.112-0.254,0.253 c0,1.482,0.806,3.248,4.655,3.248C17.501,17.007,19.099,15.91,19.099,13.993z"},postgresql:{hex:"4169E1",path:"M23.5594 14.7228a.5269.5269 0 0 0-.0563-.1191c-.139-.2632-.4768-.3418-1.0074-.2321-1.6533.3411-2.2935.1312-2.5256-.0191 1.342-2.0482 2.445-4.522 3.0411-6.8297.2714-1.0507.7982-3.5237.1222-4.7316a1.5641 1.5641 0 0 0-.1509-.235C21.6931.9086 19.8007.0248 17.5099.0005c-1.4947-.0158-2.7705.3461-3.1161.4794a9.449 9.449 0 0 0-.5159-.0816 8.044 8.044 0 0 0-1.3114-.1278c-1.1822-.0184-2.2038.2642-3.0498.8406-.8573-.3211-4.7888-1.645-7.2219.0788C.9359 2.1526.3086 3.8733.4302 6.3043c.0409.818.5069 3.334 1.2423 5.7436.4598 1.5065.9387 2.7019 1.4334 3.582.553.9942 1.1259 1.5933 1.7143 1.7895.4474.1491 1.1327.1441 1.8581-.7279.8012-.9635 1.5903-1.8258 1.9446-2.2069.4351.2355.9064.3625 1.39.3772a.0569.0569 0 0 0 .0004.0041 11.0312 11.0312 0 0 0-.2472.3054c-.3389.4302-.4094.5197-1.5002.7443-.3102.064-1.1344.2339-1.1464.8115-.0025.1224.0329.2309.0919.3268.2269.4231.9216.6097 1.015.6331 1.3345.3335 2.5044.092 3.3714-.6787-.017 2.231.0775 4.4174.3454 5.0874.2212.5529.7618 1.9045 2.4692 1.9043.2505 0 .5263-.0291.8296-.0941 1.7819-.3821 2.5557-1.1696 2.855-2.9059.1503-.8707.4016-2.8753.5388-4.1012.0169-.0703.0357-.1207.057-.1362.0007-.0005.0697-.0471.4272.0307a.3673.3673 0 0 0 .0443.0068l.2539.0223.0149.001c.8468.0384 1.9114-.1426 2.5312-.4308.6438-.2988 1.8057-1.0323 1.5951-1.6698zM2.371 11.8765c-.7435-2.4358-1.1779-4.8851-1.2123-5.5719-.1086-2.1714.4171-3.6829 1.5623-4.4927 1.8367-1.2986 4.8398-.5408 6.108-.13-.0032.0032-.0066.0061-.0098.0094-2.0238 2.044-1.9758 5.536-1.9708 5.7495-.0002.0823.0066.1989.0162.3593.0348.5873.0996 1.6804-.0735 2.9184-.1609 1.1504.1937 2.2764.9728 3.0892.0806.0841.1648.1631.2518.2374-.3468.3714-1.1004 1.1926-1.9025 2.1576-.5677.6825-.9597.5517-1.0886.5087-.3919-.1307-.813-.5871-1.2381-1.3223-.4796-.839-.9635-2.0317-1.4155-3.5126zm6.0072 5.0871c-.1711-.0428-.3271-.1132-.4322-.1772.0889-.0394.2374-.0902.4833-.1409 1.2833-.2641 1.4815-.4506 1.9143-1.0002.0992-.126.2116-.2687.3673-.4426a.3549.3549 0 0 0 .0737-.1298c.1708-.1513.2724-.1099.4369-.0417.156.0646.3078.26.3695.4752.0291.1016.0619.2945-.0452.4444-.9043 1.2658-2.2216 1.2494-3.1676 1.0128zm2.094-3.988-.0525.141c-.133.3566-.2567.6881-.3334 1.003-.6674-.0021-1.3168-.2872-1.8105-.8024-.6279-.6551-.9131-1.5664-.7825-2.5004.1828-1.3079.1153-2.4468.079-3.0586-.005-.0857-.0095-.1607-.0122-.2199.2957-.2621 1.6659-.9962 2.6429-.7724.4459.1022.7176.4057.8305.928.5846 2.7038.0774 3.8307-.3302 4.7363-.084.1866-.1633.3629-.2311.5454zm7.3637 4.5725c-.0169.1768-.0358.376-.0618.5959l-.146.4383a.3547.3547 0 0 0-.0182.1077c-.0059.4747-.054.6489-.115.8693-.0634.2292-.1353.4891-.1794 1.0575-.11 1.4143-.8782 2.2267-2.4172 2.5565-1.5155.3251-1.7843-.4968-2.0212-1.2217a6.5824 6.5824 0 0 0-.0769-.2266c-.2154-.5858-.1911-1.4119-.1574-2.5551.0165-.5612-.0249-1.9013-.3302-2.6462.0044-.2932.0106-.5909.019-.8918a.3529.3529 0 0 0-.0153-.1126 1.4927 1.4927 0 0 0-.0439-.208c-.1226-.4283-.4213-.7866-.7797-.9351-.1424-.059-.4038-.1672-.7178-.0869.067-.276.1831-.5875.309-.9249l.0529-.142c.0595-.16.134-.3257.213-.5012.4265-.9476 1.0106-2.2453.3766-5.1772-.2374-1.0981-1.0304-1.6343-2.2324-1.5098-.7207.0746-1.3799.3654-1.7088.5321a5.6716 5.6716 0 0 0-.1958.1041c.0918-1.1064.4386-3.1741 1.7357-4.4823a4.0306 4.0306 0 0 1 .3033-.276.3532.3532 0 0 0 .1447-.0644c.7524-.5706 1.6945-.8506 2.802-.8325.4091.0067.8017.0339 1.1742.081 1.939.3544 3.2439 1.4468 4.0359 2.3827.8143.9623 1.2552 1.9315 1.4312 2.4543-1.3232-.1346-2.2234.1268-2.6797.779-.9926 1.4189.543 4.1729 1.2811 5.4964.1353.2426.2522.4522.2889.5413.2403.5825.5515.9713.7787 1.2552.0696.087.1372.1714.1885.245-.4008.1155-1.1208.3825-1.0552 1.717-.0123.1563-.0423.4469-.0834.8148-.0461.2077-.0702.4603-.0994.7662zm.8905-1.6211c-.0405-.8316.2691-.9185.5967-1.0105a2.8566 2.8566 0 0 0 .135-.0406 1.202 1.202 0 0 0 .1342.103c.5703.3765 1.5823.4213 3.0068.1344-.2016.1769-.5189.3994-.9533.6011-.4098.1903-1.0957.333-1.7473.3636-.7197.0336-1.0859-.0807-1.1721-.151zm.5695-9.2712c-.0059.3508-.0542.6692-.1054 1.0017-.055.3576-.112.7274-.1264 1.1762-.0142.4368.0404.8909.0932 1.3301.1066.887.216 1.8003-.2075 2.7014a3.5272 3.5272 0 0 1-.1876-.3856c-.0527-.1276-.1669-.3326-.3251-.6162-.6156-1.1041-2.0574-3.6896-1.3193-4.7446.3795-.5427 1.3408-.5661 2.1781-.463zm.2284 7.0137a12.3762 12.3762 0 0 0-.0853-.1074l-.0355-.0444c.7262-1.1995.5842-2.3862.4578-3.4385-.0519-.4318-.1009-.8396-.0885-1.2226.0129-.4061.0666-.7543.1185-1.0911.0639-.415.1288-.8443.1109-1.3505.0134-.0531.0188-.1158.0118-.1902-.0457-.4855-.5999-1.938-1.7294-3.253-.6076-.7073-1.4896-1.4972-2.6889-2.0395.5251-.1066 1.2328-.2035 2.0244-.1859 2.0515.0456 3.6746.8135 4.8242 2.2824a.908.908 0 0 1 .0667.1002c.7231 1.3556-.2762 6.2751-2.9867 10.5405zm-8.8166-6.1162c-.025.1794-.3089.4225-.6211.4225a.5821.5821 0 0 1-.0809-.0056c-.1873-.026-.3765-.144-.5059-.3156-.0458-.0605-.1203-.178-.1055-.2844.0055-.0401.0261-.0985.0925-.1488.1182-.0894.3518-.1226.6096-.0867.3163.0441.6426.1938.6113.4186zm7.9305-.4114c.0111.0792-.049.201-.1531.3102-.0683.0717-.212.1961-.4079.2232a.5456.5456 0 0 1-.075.0052c-.2935 0-.5414-.2344-.5607-.3717-.024-.1765.2641-.3106.5611-.352.297-.0414.6111.0088.6356.1851z"},vite:{hex:"646CFF",path:"m8.286 10.578.512-8.657a.306.306 0 0 1 .247-.282L17.377.006a.306.306 0 0 1 .353.385l-1.558 5.403a.306.306 0 0 0 .352.385l2.388-.46a.306.306 0 0 1 .332.438l-6.79 13.55-.123.19a.294.294 0 0 1-.252.14c-.177 0-.35-.152-.305-.369l1.095-5.301a.306.306 0 0 0-.388-.355l-1.433.435a.306.306 0 0 1-.389-.354l.69-3.375a.306.306 0 0 0-.37-.36l-2.32.536a.306.306 0 0 1-.374-.316zm14.976-7.926L17.284 3.74l-.544 1.887 2.077-.4a.8.8 0 0 1 .84.369.8.8 0 0 1 .034.783L12.9 19.93l-.013.025-.015.023-.122.19a.801.801 0 0 1-.672.37.826.826 0 0 1-.634-.302.8.8 0 0 1-.16-.67l1.029-4.981-1.12.34a.81.81 0 0 1-.86-.262.802.802 0 0 1-.165-.67l.63-3.08-2.027.468a.808.808 0 0 1-.768-.233.81.81 0 0 1-.217-.6l.389-6.57-7.44-1.33a.612.612 0 0 0-.64.906L11.58 23.691a.612.612 0 0 0 1.066-.004l11.26-20.135a.612.612 0 0 0-.644-.9z"},angular:{hex:"0F0F11",path:"M16.712 17.711H7.288l-1.204 2.916L12 24l5.916-3.373-1.204-2.916ZM14.692 0l7.832 16.855.814-12.856L14.692 0ZM9.308 0 .662 3.999l.814 12.856L9.308 0Zm-.405 13.93h6.198L12 6.396 8.903 13.93Z"},vuedotjs:{hex:"4FC08D",path:"M24,1.61H14.06L12,5.16,9.94,1.61H0L12,22.39ZM12,14.08,5.16,2.23H9.59L12,6.41l2.41-4.18h4.43Z"},dotnet:{hex:"512BD4",path:"M24 8.77h-2.468v7.565h-1.425V8.77h-2.462V7.53H24zm-6.852 7.565h-4.821V7.53h4.63v1.24h-3.205v2.494h2.953v1.234h-2.953v2.604h3.396zm-6.708 0H8.882L4.78 9.863a2.896 2.896 0 0 1-.258-.51h-.036c.032.189.048.592.048 1.21v5.772H3.157V7.53h1.659l3.965 6.32c.167.261.275.442.323.54h.024c-.04-.233-.06-.629-.06-1.185V7.529h1.372zm-8.703-.693a.868.829 0 0 1-.869.829.868.829 0 0 1-.868-.83.868.829 0 0 1 .868-.828.868.829 0 0 1 .869.829Z"},python:{hex:"3776AB",path:"M14.25.18l.9.2.73.26.59.3.45.32.34.34.25.34.16.33.1.3.04.26.02.2-.01.13V8.5l-.05.63-.13.55-.21.46-.26.38-.3.31-.33.25-.35.19-.35.14-.33.1-.3.07-.26.04-.21.02H8.77l-.69.05-.59.14-.5.22-.41.27-.33.32-.27.35-.2.36-.15.37-.1.35-.07.32-.04.27-.02.21v3.06H3.17l-.21-.03-.28-.07-.32-.12-.35-.18-.36-.26-.36-.36-.35-.46-.32-.59-.28-.73-.21-.88-.14-1.05-.05-1.23.06-1.22.16-1.04.24-.87.32-.71.36-.57.4-.44.42-.33.42-.24.4-.16.36-.1.32-.05.24-.01h.16l.06.01h8.16v-.83H6.18l-.01-2.75-.02-.37.05-.34.11-.31.17-.28.25-.26.31-.23.38-.2.44-.18.51-.15.58-.12.64-.1.71-.06.77-.04.84-.02 1.27.05zm-6.3 1.98l-.23.33-.08.41.08.41.23.34.33.22.41.09.41-.09.33-.22.23-.34.08-.41-.08-.41-.23-.33-.33-.22-.41-.09-.41.09zm13.09 3.95l.28.06.32.12.35.18.36.27.36.35.35.47.32.59.28.73.21.88.14 1.04.05 1.23-.06 1.23-.16 1.04-.24.86-.32.71-.36.57-.4.45-.42.33-.42.24-.4.16-.36.09-.32.05-.24.02-.16-.01h-8.22v.82h5.84l.01 2.76.02.36-.05.34-.11.31-.17.29-.25.25-.31.24-.38.2-.44.17-.51.15-.58.13-.64.09-.71.07-.77.04-.84.01-1.27-.04-1.07-.14-.9-.2-.73-.25-.59-.3-.45-.33-.34-.34-.25-.34-.16-.33-.1-.3-.04-.25-.02-.2.01-.13v-5.34l.05-.64.13-.54.21-.46.26-.38.3-.32.33-.24.35-.2.35-.14.33-.1.3-.06.26-.04.21-.02.13-.01h5.84l.69-.05.59-.14.5-.21.41-.28.33-.32.27-.35.2-.36.15-.36.1-.35.07-.32.04-.28.02-.21V6.07h2.09l.14.01zm-6.47 14.25l-.23.33-.08.41.08.41.23.33.33.23.41.08.41-.08.33-.23.23-.33.08-.41-.08-.41-.23-.33-.33-.23-.41-.08-.41.08z"},jest:{hex:"C21325",path:"M22.251 11.82a3.117 3.117 0 0 0-2.328-3.01L22.911 0H8.104L11.1 8.838a3.116 3.116 0 0 0-2.244 2.988c0 1.043.52 1.967 1.313 2.536a8.279 8.279 0 0 1-1.084 1.244 8.14 8.14 0 0 1-2.55 1.647c-.834-.563-1.195-1.556-.869-2.446a3.11 3.11 0 0 0-.91-6.08 3.117 3.117 0 0 0-3.113 3.113c0 .848.347 1.626.903 2.182-.048.097-.097.195-.146.299-.465.959-.993 2.043-1.195 3.259-.403 2.432.257 4.384 1.849 5.489A5.093 5.093 0 0 0 5.999 24c1.827 0 3.682-.917 5.475-1.807 1.279-.632 2.599-1.292 3.898-1.612.48-.118.98-.187 1.508-.264 1.07-.153 2.175-.312 3.168-.89a4.482 4.482 0 0 0 2.182-3.091c.174-.994 0-1.994-.444-2.87.298-.48.465-1.042.465-1.647zm-1.355 0c0 .965-.785 1.75-1.75 1.75a1.753 1.753 0 0 1-1.085-3.126l.007-.007c.056-.042.118-.084.18-.125 0 0 .008 0 .008-.007.028-.014.055-.035.083-.05.007 0 .014-.006.021-.006.028-.014.063-.028.097-.042.035-.014.07-.027.098-.041.007 0 .013-.007.02-.007.028-.007.056-.021.084-.028.007 0 .02-.007.028-.007.034-.007.062-.014.097-.02h.007l.104-.022c.007 0 .02 0 .028-.007.028 0 .055-.007.083-.007h.035c.035 0 .07-.007.111-.007h.09c.028 0 .05 0 .077.007h.014c.055.007.111.014.167.028a1.766 1.766 0 0 1 1.396 1.723zM10.043 1.39h10.93l-2.509 7.4c-.104.02-.208.055-.312.09l-2.64-5.385-2.648 5.35c-.104-.034-.216-.055-.327-.076l-2.494-7.38zm4.968 9.825a3.083 3.083 0 0 0-.938-1.668l1.438-2.904 1.452 2.967c-.43.43-.743.98-.868 1.605H15.01zm-3.481-1.098c.034-.007.062-.014.097-.02h.02c.029-.008.056-.008.084-.015h.028c.028 0 .049-.007.076-.007h.271c.028 0 .049.007.07.007.014 0 .02 0 .035.007.027.007.048.007.076.014.007 0 .014 0 .028.007l.097.02h.007c.028.008.056.015.083.029.007 0 .014.007.028.007.021.007.049.014.07.027.007 0 .014.007.02.007.028.014.056.021.084.035h.007a.374.374 0 0 1 .09.049h.007c.028.014.056.034.084.048.007 0 .007.007.013.007.028.014.05.035.077.049l.007.007c.083.062.16.132.236.201l.007.007a1.747 1.747 0 0 1 .48 1.209 1.752 1.752 0 0 1-3.502 0 1.742 1.742 0 0 1 1.32-1.695zm-6.838-.049c.966 0 1.751.786 1.751 1.751s-.785 1.751-1.75 1.751-1.752-.785-1.752-1.75.786-1.752 1.751-1.752zm16.163 6.025a3.07 3.07 0 0 1-1.508 2.133c-.758.438-1.689.577-2.669.716a17.29 17.29 0 0 0-1.64.291c-1.445.355-2.834 1.05-4.182 1.717-1.724.854-3.35 1.66-4.857 1.66a3.645 3.645 0 0 1-2.154-.688c-1.529-1.056-1.453-3.036-1.272-4.12.167-1.015.632-1.966 1.077-2.877.028-.055.049-.104.077-.16.152.056.312.098.479.126-.264 1.473.486 2.994 1.946 3.745l.264.139.284-.104c1.216-.431 2.342-1.133 3.336-2.071a9.334 9.334 0 0 0 1.445-1.716c.16.027.32.034.48.034a3.117 3.117 0 0 0 3.008-2.327h1.167a3.109 3.109 0 0 0 3.01 2.327c.576 0 1.11-.16 1.57-.43.18.52.236 1.063.139 1.605z"},prettier:{hex:"F7B93E",path:"M8.571 23.429A.571.571 0 0 1 8 24H2.286a.571.571 0 0 1 0-1.143H8c.316 0 .571.256.571.572zM8 20.57H6.857a.571.571 0 0 0 0 1.143H8a.571.571 0 0 0 0-1.143zm-5.714 1.143H4.57a.571.571 0 0 0 0-1.143H2.286a.571.571 0 0 0 0 1.143zM8 18.286H2.286a.571.571 0 0 0 0 1.143H8a.571.571 0 0 0 0-1.143zM16 16H5.714a.571.571 0 0 0 0 1.143H16A.571.571 0 0 0 16 16zM2.286 17.143h1.143a.571.571 0 0 0 0-1.143H2.286a.571.571 0 0 0 0 1.143zm17.143-3.429H16a.571.571 0 0 0 0 1.143h3.429a.571.571 0 0 0 0-1.143zM9.143 14.857h4.571a.571.571 0 0 0 0-1.143H9.143a.571.571 0 0 0 0 1.143zm-6.857 0h4.571a.571.571 0 0 0 0-1.143H2.286a.571.571 0 0 0 0 1.143zM20.57 11.43H11.43a.571.571 0 0 0 0 1.142h9.142a.571.571 0 0 0 0-1.142zM9.714 12a.571.571 0 0 0-.571-.571H5.714a.571.571 0 0 0 0 1.142h3.429A.571.571 0 0 0 9.714 12zm-7.428.571h1.143a.571.571 0 0 0 0-1.142H2.286a.571.571 0 0 0 0 1.142zm19.428-3.428H16a.571.571 0 0 0 0 1.143h5.714a.571.571 0 0 0 0-1.143zM2.286 10.286H8a.571.571 0 0 0 0-1.143H2.286a.571.571 0 0 0 0 1.143zm13.143-2.857c0 .315.255.571.571.571h5.714a.571.571 0 0 0 0-1.143H16a.571.571 0 0 0-.571.572zm-8.572-.572a.571.571 0 0 0 0 1.143H8a.571.571 0 0 0 0-1.143H6.857zM2.286 8H4.57a.571.571 0 0 0 0-1.143H2.286a.571.571 0 0 0 0 1.143zm16.571-2.857c0 .315.256.571.572.571h1.142a.571.571 0 0 0 0-1.143H19.43a.571.571 0 0 0-.572.572zm-1.143 0a.571.571 0 0 0-.571-.572H12.57a.571.571 0 0 0 0 1.143h4.572a.571.571 0 0 0 .571-.571zm-15.428.571h8a.571.571 0 0 0 0-1.143h-8a.571.571 0 0 0 0 1.143zm5.143-2.857c0 .316.255.572.571.572h11.429a.571.571 0 0 0 0-1.143H8a.571.571 0 0 0-.571.571zm-5.143.572h3.428a.571.571 0 0 0 0-1.143H2.286a.571.571 0 0 0 0 1.143zm0-2.286H16A.571.571 0 0 0 16 0H2.286a.571.571 0 0 0 0 1.143z"},express:{hex:"000000",path:"M24 18.588a1.529 1.529 0 01-1.895-.72l-3.45-4.771-.5-.667-4.003 5.444a1.466 1.466 0 01-1.802.708l5.158-6.92-4.798-6.251a1.595 1.595 0 011.9.666l3.576 4.83 3.596-4.81a1.435 1.435 0 011.788-.668L21.708 7.9l-2.522 3.283a.666.666 0 000 .994l4.804 6.412zM.002 11.576l.42-2.075c1.154-4.103 5.858-5.81 9.094-3.27 1.895 1.489 2.368 3.597 2.275 5.973H1.116C.943 16.447 4.005 19.009 7.92 17.7a4.078 4.078 0 002.582-2.876c.207-.666.548-.78 1.174-.588a5.417 5.417 0 01-2.589 3.957 6.272 6.272 0 01-7.306-.933 6.575 6.575 0 01-1.64-3.858c0-.235-.08-.455-.134-.666A88.33 88.33 0 010 11.577zm1.127-.286h9.654c-.06-3.076-2.001-5.258-4.59-5.278-2.882-.04-4.944 2.094-5.071 5.264z"},mongodb:{hex:"47A248",path:"M17.193 9.555c-1.264-5.58-4.252-7.414-4.573-8.115-.28-.394-.53-.954-.735-1.44-.036.495-.055.685-.523 1.184-.723.566-4.438 3.682-4.74 10.02-.282 5.912 4.27 9.435 4.888 9.884l.07.05A73.49 73.49 0 0111.91 24h.481c.114-1.032.284-2.056.51-3.07.417-.296.604-.463.85-.693a11.342 11.342 0 003.639-8.464c.01-.814-.103-1.662-.197-2.218zm-5.336 8.195s0-8.291.275-8.29c.213 0 .49 10.695.49 10.695-.381-.045-.765-1.76-.765-2.405z"},mysql:{hex:"4479A1",path:"M16.405 5.501c-.115 0-.193.014-.274.033v.013h.014c.054.104.146.18.214.273.054.107.1.214.154.32l.014-.015c.094-.066.14-.172.14-.333-.04-.047-.046-.094-.08-.14-.04-.067-.126-.1-.18-.153zM5.77 18.695h-.927a50.854 50.854 0 00-.27-4.41h-.008l-1.41 4.41H2.45l-1.4-4.41h-.01a72.892 72.892 0 00-.195 4.41H0c.055-1.966.192-3.81.41-5.53h1.15l1.335 4.064h.008l1.347-4.064h1.095c.242 2.015.384 3.86.428 5.53zm4.017-4.08c-.378 2.045-.876 3.533-1.492 4.46-.482.716-1.01 1.073-1.583 1.073-.153 0-.34-.046-.566-.138v-.494c.11.017.24.026.386.026.268 0 .483-.075.647-.222.197-.18.295-.382.295-.605 0-.155-.077-.47-.23-.944L6.23 14.615h.91l.727 2.36c.164.536.233.91.205 1.123.4-1.064.678-2.227.835-3.483zm12.325 4.08h-2.63v-5.53h.885v4.85h1.745zm-3.32.135l-1.016-.5c.09-.076.177-.158.255-.25.433-.506.648-1.258.648-2.253 0-1.83-.718-2.746-2.155-2.746-.704 0-1.254.232-1.65.697-.43.508-.646 1.256-.646 2.245 0 .972.19 1.686.574 2.14.35.41.877.615 1.583.615.264 0 .506-.033.725-.098l1.325.772.36-.622zM15.5 17.588c-.225-.36-.337-.94-.337-1.736 0-1.393.424-2.09 1.27-2.09.443 0 .77.167.977.5.224.362.336.936.336 1.723 0 1.404-.424 2.108-1.27 2.108-.445 0-.77-.167-.978-.5zm-1.658-.425c0 .47-.172.856-.516 1.156-.344.3-.803.45-1.384.45-.543 0-1.064-.172-1.573-.515l.237-.476c.438.22.833.328 1.19.328.332 0 .593-.073.783-.22a.754.754 0 00.3-.615c0-.33-.23-.61-.648-.845-.388-.213-1.163-.657-1.163-.657-.422-.307-.632-.636-.632-1.177 0-.45.157-.81.47-1.085.315-.278.72-.415 1.22-.415.512 0 .98.136 1.4.41l-.213.476a2.726 2.726 0 00-1.064-.23c-.283 0-.502.068-.654.206a.685.685 0 00-.248.524c0 .328.234.61.666.85.393.215 1.187.67 1.187.67.433.305.648.63.648 1.168zm9.382-5.852c-.535-.014-.95.04-1.297.188-.1.04-.26.04-.274.167.055.053.063.14.11.214.08.134.218.313.346.407.14.11.28.216.427.31.26.16.555.255.81.416.145.094.293.213.44.313.073.05.12.14.214.172v-.02c-.046-.06-.06-.147-.105-.214-.067-.067-.134-.127-.2-.193a3.223 3.223 0 00-.695-.675c-.214-.146-.682-.35-.77-.595l-.013-.014c.146-.013.32-.066.46-.106.227-.06.435-.047.67-.106.106-.027.213-.06.32-.094v-.06c-.12-.12-.21-.283-.334-.395a8.867 8.867 0 00-1.104-.823c-.21-.134-.476-.22-.697-.334-.08-.04-.214-.06-.26-.127-.12-.146-.19-.34-.275-.514a17.69 17.69 0 01-.547-1.163c-.12-.262-.193-.523-.34-.763-.69-1.137-1.437-1.826-2.586-2.5-.247-.14-.543-.2-.856-.274-.167-.008-.334-.02-.5-.027-.11-.047-.216-.174-.31-.235-.38-.24-1.364-.76-1.644-.072-.18.434.267.862.422 1.082.115.153.26.328.34.5.047.116.06.235.107.356.106.294.207.622.347.897.073.14.153.287.247.413.054.073.146.107.167.227-.094.136-.1.334-.154.5-.24.757-.146 1.693.194 2.25.107.166.362.534.703.393.3-.12.234-.5.32-.835.02-.08.007-.133.048-.187v.015c.094.188.188.367.274.555.206.328.566.668.867.895.16.12.287.328.487.402v-.02h-.015c-.043-.058-.1-.086-.154-.133a3.445 3.445 0 01-.35-.4 8.76 8.76 0 01-.747-1.218c-.11-.21-.202-.436-.29-.643-.04-.08-.04-.2-.107-.24-.1.146-.247.273-.32.453-.127.288-.14.642-.188 1.01-.027.007-.014 0-.027.014-.214-.052-.287-.274-.367-.46-.2-.475-.233-1.238-.06-1.785.047-.14.247-.582.167-.716-.042-.127-.174-.2-.247-.303a2.478 2.478 0 01-.24-.427c-.16-.374-.24-.788-.414-1.162-.08-.173-.22-.354-.334-.513-.127-.18-.267-.307-.368-.52-.033-.073-.08-.194-.027-.274.014-.054.042-.075.094-.09.088-.072.335.022.422.062.247.1.455.194.662.334.094.066.195.193.315.226h.14c.214.047.455.014.655.073.355.114.675.28.962.46a5.953 5.953 0 012.085 2.286c.08.154.115.295.188.455.14.33.313.663.455.982.14.315.275.636.476.897.1.14.502.213.682.286.133.06.34.115.46.188.23.14.454.3.67.454.11.076.443.243.463.378z"},redis:{hex:"FF4438",path:"M22.71 13.145c-1.66 2.092-3.452 4.483-7.038 4.483-3.203 0-4.397-2.825-4.48-5.12.701 1.484 2.073 2.685 4.214 2.63 4.117-.133 6.94-3.852 6.94-7.239 0-4.05-3.022-6.972-8.268-6.972-3.752 0-8.4 1.428-11.455 3.685C2.59 6.937 3.885 9.958 4.35 9.626c2.648-1.904 4.748-3.13 6.784-3.744C8.12 9.244.886 17.05 0 18.425c.1 1.261 1.66 4.648 2.424 4.648.232 0 .431-.133.664-.365a100.49 100.49 0 0 0 5.54-6.765c.222 3.104 1.748 6.898 6.014 6.898 3.819 0 7.604-2.756 9.33-8.965.2-.764-.73-1.361-1.261-.73zm-4.349-5.013c0 1.959-1.926 2.922-3.685 2.922-.941 0-1.664-.247-2.235-.568 1.051-1.592 2.092-3.225 3.21-4.973 1.972.334 2.71 1.43 2.71 2.619z"},docker:{hex:"2496ED",path:"M13.983 11.078h2.119a.186.186 0 00.186-.185V9.006a.186.186 0 00-.186-.186h-2.119a.185.185 0 00-.185.185v1.888c0 .102.083.185.185.185m-2.954-5.43h2.118a.186.186 0 00.186-.186V3.574a.186.186 0 00-.186-.185h-2.118a.185.185 0 00-.185.185v1.888c0 .102.082.185.185.185m0 2.716h2.118a.187.187 0 00.186-.186V6.29a.186.186 0 00-.186-.185h-2.118a.185.185 0 00-.185.185v1.887c0 .102.082.185.185.186m-2.93 0h2.12a.186.186 0 00.184-.186V6.29a.185.185 0 00-.185-.185H8.1a.185.185 0 00-.185.185v1.887c0 .102.083.185.185.186m-2.964 0h2.119a.186.186 0 00.185-.186V6.29a.185.185 0 00-.185-.185H5.136a.186.186 0 00-.186.185v1.887c0 .102.084.185.186.186m5.893 2.715h2.118a.186.186 0 00.186-.185V9.006a.186.186 0 00-.186-.186h-2.118a.185.185 0 00-.185.185v1.888c0 .102.082.185.185.185m-2.93 0h2.12a.185.185 0 00.184-.185V9.006a.185.185 0 00-.184-.186h-2.12a.185.185 0 00-.184.185v1.888c0 .102.083.185.185.185m-2.964 0h2.119a.185.185 0 00.185-.185V9.006a.185.185 0 00-.184-.186h-2.12a.186.186 0 00-.186.186v1.887c0 .102.084.185.186.185m-2.92 0h2.12a.185.185 0 00.184-.185V9.006a.185.185 0 00-.184-.186h-2.12a.185.185 0 00-.184.185v1.888c0 .102.082.185.185.185M23.763 9.89c-.065-.051-.672-.51-1.954-.51-.338.001-.676.03-1.01.087-.248-1.7-1.653-2.53-1.716-2.566l-.344-.199-.226.327c-.284.438-.49.922-.612 1.43-.23.97-.09 1.882.403 2.661-.595.332-1.55.413-1.744.42H.751a.751.751 0 00-.75.748 11.376 11.376 0 00.692 4.062c.545 1.428 1.355 2.48 2.41 3.124 1.18.723 3.1 1.137 5.275 1.137.983.003 1.963-.086 2.93-.266a12.248 12.248 0 003.823-1.389c.98-.567 1.86-1.288 2.61-2.136 1.252-1.418 1.998-2.997 2.553-4.4h.221c1.372 0 2.215-.549 2.68-1.009.309-.293.55-.65.707-1.046l.098-.288Z"},zod:{hex:"408AFF",path:"M2.584 3.582a2.247 2.247 0 0 1 2.112-1.479h14.617c.948 0 1.794.595 2.115 1.487l2.44 6.777a2.248 2.248 0 0 1-.624 2.443l-9.61 8.52a2.247 2.247 0 0 1-2.963.018L.776 12.773a2.248 2.248 0 0 1-.64-2.467Zm12.038 4.887-9.11 5.537 5.74 5.007c.456.399 1.139.396 1.593-.006l5.643-5.001H14.4l6.239-3.957c.488-.328.69-.947.491-1.5l-1.24-3.446a1.535 1.535 0 0 0-1.456-1.015H5.545a1.535 1.535 0 0 0-1.431 1.01l-1.228 3.37z"},hono:{hex:"E36002",path:"M12.445.002a45.529 45.529 0 0 0-5.252 8.146 8.595 8.595 0 0 1-.555-.53 27.796 27.796 0 0 0-1.205-1.542 8.762 8.762 0 0 0-1.251 2.12 20.743 20.743 0 0 0-1.448 5.88 8.867 8.867 0 0 0 .338 3.468c1.312 3.48 3.794 5.593 7.445 6.337 3.055.438 5.755-.333 8.097-2.312 2.677-2.59 3.359-5.634 2.047-9.132a33.287 33.287 0 0 0-2.988-5.59A91.34 91.34 0 0 0 12.615.053a.216.216 0 0 0-.17-.051Zm-.336 3.906a50.93 50.93 0 0 1 4.794 6.552c.448.767.817 1.57 1.108 2.41.606 2.386-.044 4.354-1.951 5.904-1.845 1.298-3.87 1.683-6.072 1.156-2.376-.737-3.75-2.335-4.121-4.794a5.107 5.107 0 0 1 .242-2.266c.358-.908.79-1.774 1.3-2.601l1.446-2.121a397.33 397.33 0 0 0 3.254-4.24Z"},svelte:{hex:"FF3E00",path:"M10.354 21.125a4.44 4.44 0 0 1-4.765-1.767 4.109 4.109 0 0 1-.703-3.107 3.898 3.898 0 0 1 .134-.522l.105-.321.287.21a7.21 7.21 0 0 0 2.186 1.092l.208.063-.02.208a1.253 1.253 0 0 0 .226.83 1.337 1.337 0 0 0 1.435.533 1.231 1.231 0 0 0 .343-.15l5.59-3.562a1.164 1.164 0 0 0 .524-.778 1.242 1.242 0 0 0-.211-.937 1.338 1.338 0 0 0-1.435-.533 1.23 1.23 0 0 0-.343.15l-2.133 1.36a4.078 4.078 0 0 1-1.135.499 4.44 4.44 0 0 1-4.765-1.766 4.108 4.108 0 0 1-.702-3.108 3.855 3.855 0 0 1 1.742-2.582l5.589-3.563a4.072 4.072 0 0 1 1.135-.499 4.44 4.44 0 0 1 4.765 1.767 4.109 4.109 0 0 1 .703 3.107 3.943 3.943 0 0 1-.134.522l-.105.321-.286-.21a7.204 7.204 0 0 0-2.187-1.093l-.208-.063.02-.207a1.255 1.255 0 0 0-.226-.831 1.337 1.337 0 0 0-1.435-.532 1.231 1.231 0 0 0-.343.15L8.62 9.368a1.162 1.162 0 0 0-.524.778 1.24 1.24 0 0 0 .211.937 1.338 1.338 0 0 0 1.435.533 1.235 1.235 0 0 0 .344-.151l2.132-1.36a4.067 4.067 0 0 1 1.135-.498 4.44 4.44 0 0 1 4.765 1.766 4.108 4.108 0 0 1 .702 3.108 3.857 3.857 0 0 1-1.742 2.583l-5.589 3.562a4.072 4.072 0 0 1-1.135.499m10.358-17.95C18.484-.015 14.082-.96 10.9 1.068L5.31 4.63a6.412 6.412 0 0 0-2.896 4.295 6.753 6.753 0 0 0 .666 4.336 6.43 6.43 0 0 0-.96 2.396 6.833 6.833 0 0 0 1.168 5.167c2.229 3.19 6.63 4.135 9.812 2.108l5.59-3.562a6.41 6.41 0 0 0 2.896-4.295 6.756 6.756 0 0 0-.665-4.336 6.429 6.429 0 0 0 .958-2.396 6.831 6.831 0 0 0-1.167-5.168Z"},nestjs:{hex:"E0234E",path:"M14.131.047c-.173 0-.334.037-.483.087.316.21.49.49.576.806.007.043.019.074.025.117a.681.681 0 0 1 .013.112c.024.545-.143.614-.26.936-.18.415-.13.861.086 1.22a.74.74 0 0 0 .074.137c-.235-1.568 1.073-1.803 1.314-2.293.019-.428-.334-.713-.613-.911a1.37 1.37 0 0 0-.732-.21zM16.102.4c-.024.143-.006.106-.012.18-.006.05-.006.112-.012.161-.013.05-.025.1-.044.149-.012.05-.03.1-.05.149l-.067.142c-.02.025-.031.05-.05.075l-.037.055a2.152 2.152 0 0 1-.093.124c-.037.038-.068.081-.112.112v.006c-.037.031-.074.068-.118.1-.13.099-.278.173-.415.266-.043.03-.087.056-.124.093a.906.906 0 0 0-.118.099c-.043.037-.074.074-.111.118-.031.037-.068.08-.093.124a1.582 1.582 0 0 0-.087.13c-.025.05-.043.093-.068.142-.019.05-.037.093-.05.143a2.007 2.007 0 0 0-.043.155c-.006.025-.006.056-.012.08-.007.025-.007.05-.013.075 0 .05-.006.105-.006.155 0 .037 0 .074.006.111 0 .05.006.1.019.155.006.05.018.1.03.15.02.049.032.098.05.148.013.03.031.062.044.087l-1.426-.552c-.241-.068-.477-.13-.719-.186l-.39-.093c-.372-.074-.75-.13-1.128-.167-.013 0-.019-.006-.031-.006A11.082 11.082 0 0 0 8.9 2.855c-.378.025-.756.074-1.134.136a12.45 12.45 0 0 0-.837.174l-.279.074c-.092.037-.18.08-.266.118l-.205.093c-.012.006-.024.006-.03.012-.063.031-.118.056-.174.087a2.738 2.738 0 0 0-.236.118c-.043.018-.086.043-.124.062a.559.559 0 0 1-.055.03c-.056.032-.112.063-.162.094a1.56 1.56 0 0 0-.148.093c-.044.03-.087.055-.124.086-.006.007-.013.007-.019.013-.037.025-.08.056-.118.087l-.012.012-.093.074c-.012.007-.025.019-.037.025-.031.025-.062.056-.093.08-.006.013-.019.02-.025.025-.037.038-.074.069-.111.106-.007 0-.007.006-.013.012a1.742 1.742 0 0 0-.111.106c-.007.006-.007.012-.013.012a1.454 1.454 0 0 0-.093.1c-.012.012-.03.024-.043.036a1.374 1.374 0 0 1-.106.112c-.006.012-.018.019-.024.03-.05.05-.093.1-.143.15l-.018.018c-.1.106-.205.211-.317.304-.111.1-.229.192-.347.273a3.777 3.777 0 0 1-.762.421c-.13.056-.267.106-.403.149-.26.056-.527.161-.756.18-.05 0-.105.012-.155.018l-.155.037-.149.056c-.05.019-.099.044-.148.068-.044.031-.093.056-.137.087a1.011 1.011 0 0 0-.124.106c-.043.03-.087.074-.124.111-.037.043-.074.08-.105.124-.031.05-.068.093-.093.143a1.092 1.092 0 0 0-.087.142c-.025.056-.05.106-.068.161-.019.05-.037.106-.056.161-.012.05-.025.1-.03.15 0 .005-.007.012-.007.018-.012.056-.012.13-.019.167C.006 7.95 0 7.986 0 8.03a.657.657 0 0 0 .074.31v.006c.019.037.044.075.069.112.024.037.05.074.08.111.031.031.068.069.106.1a.906.906 0 0 0 .117.099c.149.13.186.173.378.272.031.019.062.031.1.05.006 0 .012.006.018.006 0 .013 0 .019.006.031a1.272 1.272 0 0 0 .08.298c.02.037.032.074.05.111.007.013.013.025.02.031.024.05.049.093.073.137l.093.13c.031.037.069.08.106.118.037.037.074.068.118.105 0 0 .006.006.012.006.037.031.074.062.112.087a.986.986 0 0 0 .136.08c.043.025.093.05.142.069a.73.73 0 0 0 .124.043c.007.006.013.006.025.012.025.007.056.013.08.019-.018.335-.024.65.026.762.055.124.328-.254.6-.688-.036.428-.061.93 0 1.079.069.155.44-.329.763-.862 4.395-1.016 8.405 2.02 8.826 6.31-.08-.67-.905-1.041-1.283-.948-.186.458-.502 1.047-1.01 1.413.043-.41.025-.83-.062-1.24a4.009 4.009 0 0 1-.769 1.562c-.588.043-1.177-.242-1.487-.67-.025-.018-.031-.055-.05-.08-.018-.043-.037-.087-.05-.13a.515.515 0 0 1-.037-.13c-.006-.044-.006-.087-.006-.137v-.093a.992.992 0 0 1 .031-.13c.013-.043.025-.086.044-.13.024-.043.043-.087.074-.13.105-.298.105-.54-.087-.682a.706.706 0 0 0-.118-.062c-.024-.006-.055-.018-.08-.025l-.05-.018a.847.847 0 0 0-.13-.031.472.472 0 0 0-.13-.019 1.01 1.01 0 0 0-.136-.012c-.031 0-.062.006-.093.006a.484.484 0 0 0-.137.019c-.043.006-.086.012-.13.024a1.068 1.068 0 0 0-.13.044c-.043.018-.08.037-.124.056-.037.018-.074.043-.118.062-1.444.942-.582 3.148.403 3.787-.372.068-.75.148-.855.229l-.013.012c.267.161.546.298.837.416.397.13.818.247 1.004.297v.006a5.996 5.996 0 0 0 1.562.112c2.746-.192 4.996-2.281 5.405-5.033l.037.161c.019.112.043.23.056.347v.006c.012.056.018.112.025.162v.024c.006.056.012.112.012.162.006.068.012.136.012.204v.1c0 .03.007.067.007.098 0 .038-.007.075-.007.112v.087c0 .043-.006.08-.006.124 0 .025 0 .05-.006.08 0 .044-.006.087-.006.137-.006.018-.006.037-.006.055l-.02.143c0 .019 0 .037-.005.056-.007.062-.019.118-.025.18v.012l-.037.174v.018l-.037.167c0 .007-.007.02-.007.025a1.663 1.663 0 0 1-.043.168v.018c-.019.062-.037.118-.05.174-.006.006-.006.012-.006.012l-.056.186c-.024.062-.043.118-.068.18-.025.062-.043.124-.068.18-.025.062-.05.117-.074.18h-.007c-.024.055-.05.117-.08.173a.302.302 0 0 1-.019.043c-.006.006-.006.013-.012.019a5.867 5.867 0 0 1-1.742 2.082c-.05.031-.099.069-.149.106-.012.012-.03.018-.043.03a2.603 2.603 0 0 1-.136.094l.018.037h.007l.26-.037h.006c.161-.025.322-.056.483-.087.044-.006.093-.019.137-.031l.087-.019c.043-.006.086-.018.13-.024.037-.013.074-.02.111-.031.62-.15 1.221-.354 1.798-.595a9.926 9.926 0 0 1-3.85 3.142c.714-.05 1.426-.167 2.114-.366a9.903 9.903 0 0 0 5.857-4.68 9.893 9.893 0 0 1-1.667 3.986 9.758 9.758 0 0 0 1.655-1.376 9.824 9.824 0 0 0 2.61-5.268c.21.98.272 1.99.18 2.987 4.474-6.241.371-12.712-1.346-14.416-.006-.013-.012-.019-.012-.031-.006.006-.006.006-.006.012 0-.006 0-.006-.007-.012 0 .074-.006.148-.012.223a8.34 8.34 0 0 1-.062.415c-.03.136-.068.273-.105.41-.044.13-.093.266-.15.396a5.322 5.322 0 0 1-.185.378 4.735 4.735 0 0 1-.477.688c-.093.111-.192.21-.292.31a3.994 3.994 0 0 1-.18.155l-.142.124a3.459 3.459 0 0 1-.347.241 4.295 4.295 0 0 1-.366.211c-.13.062-.26.118-.39.174a4.364 4.364 0 0 1-.818.223c-.143.025-.285.037-.422.05a4.914 4.914 0 0 1-.297.012 4.66 4.66 0 0 1-.422-.025 3.137 3.137 0 0 1-.421-.062 3.136 3.136 0 0 1-.415-.105h-.007c.137-.013.273-.025.41-.05a4.493 4.493 0 0 0 .818-.223c.136-.05.266-.112.39-.174.13-.062.248-.13.372-.204.118-.08.235-.161.347-.248.112-.087.217-.18.316-.279.105-.093.198-.198.291-.304.093-.111.18-.223.26-.334.013-.019.026-.044.038-.062.062-.1.124-.199.18-.298a4.272 4.272 0 0 0 .334-.775c.044-.13.075-.266.106-.403.025-.142.05-.278.062-.415.012-.142.025-.285.025-.421 0-.1-.007-.199-.013-.298a6.726 6.726 0 0 0-.05-.415 4.493 4.493 0 0 0-.092-.415c-.044-.13-.087-.267-.137-.397-.05-.13-.111-.26-.173-.384-.069-.124-.137-.248-.211-.366a6.843 6.843 0 0 0-.248-.34c-.093-.106-.186-.212-.285-.317a3.878 3.878 0 0 0-.161-.155c-.28-.217-.57-.421-.862-.607a1.154 1.154 0 0 0-.124-.062 2.415 2.415 0 0 0-.589-.26Z"},cypress:{hex:"69D3A7",path:"M11.998.0195c-.8642 0-1.6816.1101-2.1445.1934v.002C4.1731 1.2283 0 6.1368 0 12.0018c0 1.1265.1573 2.2328.4648 3.3028.0387.1453.0915.2993.1368.4473 1.607 4.865 6.2245 8.226 11.3925 8.2285.0651 0 .2518-.0003.502-.0118.8564-.0353 1.6228-.5734 1.9512-1.369l.4736-1.1544L20.4258 8.043H18.621l-2.3164 5.871-2.334-5.871h-1.9082l3.2734 8.0117c-.8115 1.9702-1.6252 3.9395-2.4355 5.9101-.0808.1945-.2655.3284-.4727.336-.144.005-.285.0098-.4316.0098-4.5848 0-8.6672-3.0695-9.9277-7.4649a10.3058 10.3058 0 0 1-.3985-2.8437c0-5.0887 3.6521-9.3404 8.6035-10.164.2214-.037.8885-.1446 1.7246-.1446 4.4166 0 8.269 2.732 9.7305 6.8476.0558.144.0977.293.1465.4395.299.9746.4531 1.9887.4531 3.0215 0 4.5696-2.9413 8.5326-7.3164 9.8613l.4863 1.5996c5.085-1.546 8.4995-6.1518 8.502-11.459 0-1.5491-.2983-2.8706-.6504-3.8926-.0432-.1212-.0873-.2422-.1309-.3633h-.002C21.4577 3.0954 17.0444.0195 11.998.0195ZM8.4336 7.8906c-1.1999 0-2.1747.3852-2.9805 1.1758-.8007.7856-1.205 1.7736-1.205 2.9356 0 1.1544.4068 2.1368 1.205 2.9199.8058.7906 1.7806 1.1738 2.9805 1.1738 1.705 0 3.1556-.955 3.7871-2.4883l.0332-.082-1.6289-.5547c-.168.4563-.7552 1.4883-2.1914 1.4883-.6745 0-1.2437-.2344-1.6934-.6992-.4572-.4699-.6875-1.0632-.6875-1.7578 0-.6998.2253-1.2809.6875-1.7735.4522-.4648 1.019-.7012 1.6934-.7012 1.438 0 2.0238 1.0815 2.1934 1.4883l1.627-.5527-.0333-.084c-.629-1.5358-2.082-2.4883-3.7871-2.4883Z"},storybook:{hex:"FF4785",path:"M16.71.243l-.12 2.71a.18.18 0 00.29.15l1.06-.8.9.7a.18.18 0 00.28-.14l-.1-2.76 1.33-.1a1.2 1.2 0 011.279 1.2v21.596a1.2 1.2 0 01-1.26 1.2l-16.096-.72a1.2 1.2 0 01-1.15-1.16l-.75-19.797a1.2 1.2 0 011.13-1.27L16.7.222zM13.64 9.3c0 .47 3.16.24 3.59-.08 0-3.2-1.72-4.89-4.859-4.89-3.15 0-4.899 1.72-4.899 4.29 0 4.45 5.999 4.53 5.999 6.959 0 .7-.32 1.1-1.05 1.1-.96 0-1.35-.49-1.3-2.16 0-.36-3.649-.48-3.769 0-.27 4.03 2.23 5.2 5.099 5.2 2.79 0 4.969-1.49 4.969-4.18 0-4.77-6.099-4.64-6.099-6.999 0-.97.72-1.1 1.13-1.1.45 0 1.25.07 1.19 1.87z"},graphql:{hex:"E10098",path:"M12.002 0a2.138 2.138 0 1 0 0 4.277 2.138 2.138 0 1 0 0-4.277zm8.54 4.931a2.138 2.138 0 1 0 0 4.277 2.138 2.138 0 1 0 0-4.277zm0 9.862a2.138 2.138 0 1 0 0 4.277 2.138 2.138 0 1 0 0-4.277zm-8.54 4.931a2.138 2.138 0 1 0 0 4.276 2.138 2.138 0 1 0 0-4.276zm-8.542-4.93a2.138 2.138 0 1 0 0 4.276 2.138 2.138 0 1 0 0-4.277zm0-9.863a2.138 2.138 0 1 0 0 4.277 2.138 2.138 0 1 0 0-4.277zm8.542-3.378L2.953 6.777v10.448l9.049 5.224 9.047-5.224V6.777zm0 1.601 7.66 13.27H4.34zm-1.387.371L3.97 15.037V7.363zm2.774 0 6.646 3.838v7.674zM5.355 17.44h13.293l-6.646 3.836z"},trpc:{hex:"2596BE",path:"M24 12c0 6.62-5.38 12-12 12S0 18.62 0 12 5.38 0 12 0s12 5.38 12 12ZM1.21 12A10.78 10.78 0 0 0 12 22.79 10.78 10.78 0 0 0 22.79 12 10.78 10.78 0 0 0 12 1.21 10.78 10.78 0 0 0 1.21 12Zm10.915-6.086 2.162 1.248a.25.25 0 0 1 .125.217v1.103l2.473 1.428a.25.25 0 0 1 .125.217v2.355l.955.551a.25.25 0 0 1 .125.217v2.496a.25.25 0 0 1-.125.217l-2.162 1.248a.25.25 0 0 1-.25 0l-.956-.552-2.472 1.427a.25.25 0 0 1-.25 0l-2.472-1.427-.956.552a.25.25 0 0 1-.25 0l-2.162-1.248a.25.25 0 0 1-.125-.217V13.25a.25.25 0 0 1 .125-.217l.955-.551v-2.355a.25.25 0 0 1 .125-.217l2.473-1.428V7.38a.25.25 0 0 1 .125-.217l2.162-1.248a.25.25 0 0 1 .25 0Zm1.268 10.049a.25.25 0 0 1-.125-.217V13.25a.25.25 0 0 1 .125-.217l2.16-1.248a.25.25 0 0 1 .25 0l.707.408v-1.922l-2.098-1.21v.814a.25.25 0 0 1-.125.217l-2.162 1.248a.25.25 0 0 1-.25 0l-2.162-1.248a.25.25 0 0 1-.125-.217V9.06L7.49 10.271v1.922l.707-.408a.25.25 0 0 1 .25 0l2.16 1.248a.25.25 0 0 1 .125.217v2.496a.25.25 0 0 1-.125.217l-.705.408L12 17.582l2.098-1.211ZM10.088 9.73l1.662.96V8.766l-1.662-.955Zm3.824 0V7.811l-1.662.955v1.924ZM12 6.418l-1.66.96 1.66.954 1.66-.954Zm-5.59 9.184 1.66.958v-1.921l-1.66-.956Zm3.822 0v-1.92l-1.662.957v1.923Zm-1.91-3.311-1.662.96 1.661.955 1.66-.956Zm5.446 3.31 1.66.96v-1.922l-1.66-.956Zm3.822 0v-1.918l-1.662.956v1.922Zm-1.912-3.31-1.66.96 1.66.955 1.66-.956Z"},redux:{hex:"764ABC",path:"M16.634 16.504c.87-.075 1.543-.84 1.5-1.754-.047-.914-.796-1.648-1.709-1.648h-.061a1.71 1.71 0 00-1.648 1.769c.03.479.226.869.494 1.153-1.048 2.038-2.621 3.536-5.005 4.795-1.603.838-3.296 1.154-4.944.93-1.378-.195-2.456-.81-3.116-1.799-.988-1.499-1.078-3.116-.255-4.734.6-1.17 1.499-2.023 2.099-2.443a9.96 9.96 0 01-.42-1.543C-.868 14.408-.416 18.752.932 20.805c1.004 1.498 3.057 2.456 5.304 2.456.6 0 1.23-.044 1.843-.194 3.897-.749 6.848-3.086 8.541-6.532zm5.348-3.746c-2.32-2.728-5.738-4.226-9.634-4.226h-.51c-.253-.554-.837-.899-1.498-.899h-.045c-.943 0-1.678.81-1.647 1.753.03.898.794 1.648 1.708 1.648h.074a1.69 1.69 0 001.499-1.049h.555c2.309 0 4.495.674 6.488 1.992 1.527 1.005 2.622 2.323 3.237 3.897.538 1.288.509 2.547-.045 3.597-.855 1.647-2.294 2.517-4.196 2.517-1.199 0-2.367-.375-2.967-.644-.36.298-.96.793-1.394 1.093 1.318.598 2.652.943 3.94.943 2.922 0 5.094-1.647 5.919-3.236.898-1.798.824-4.824-1.47-7.416zM6.49 17.042c.03.899.793 1.648 1.708 1.648h.06a1.688 1.688 0 001.648-1.768c0-.9-.779-1.647-1.693-1.647h-.06c-.06 0-.15 0-.226.029-1.243-2.098-1.768-4.347-1.572-6.772.12-1.828.72-3.417 1.797-4.735.9-1.124 2.593-1.68 3.747-1.708 3.236-.061 4.585 3.971 4.689 5.574l1.498.45C17.741 3.197 14.686.62 11.764.62 9.02.62 6.49 2.613 5.47 5.535 4.077 9.43 4.991 13.177 6.7 16.174c-.15.195-.24.539-.21.868z"},i18next:{hex:"26A69A",path:"M14.93646 2.48699v4.51684l5.0758 13.03647s1.5495 3.1839-2.8824 3.9597H7.01922s-4.13084-.4311-3.14053-3.7019L9.21276 7.00401V2.48699h5.7237Zm2.0894 13.10781c-4.4301-1.3742-8.15457-.6365-9.97498-.0788l-1.83572 4.4186c-.78296 2.499 2.27302 2.9417 2.59687 2.9813l.02755.0032h8.44448c3.5407-.5982 2.511-2.972 2.4147-3.1773l-.0068-.0142-1.6661-4.1328Zm-7.81345.7772c.78905.0004 1.42905.3862 1.42905.8646 0 .4764-.6404.864-1.42905.864-.7887 0-1.42711-.3878-1.42711-.864 0-.4784.6384-.8646 1.4271-.8646Zm5.08375 0c.7871.0004 1.4271.3862 1.4271.8646 0 .4764-.6403.864-1.4271.864-.791 0-1.429-.3878-1.429-.864 0-.4784.638-.8646 1.429-.8646Zm-4.5001-5.2131c-.55227 0-.99993.5395-.99993 1.2051 0 .6656.44766 1.2051.99993 1.2051.5522 0 .9998-.5395.9998-1.2051 0-.6656-.4476-1.2051-.9998-1.2051Zm3.6413-1.29686c-.6549 0-1.1862.63806-1.1862 1.42906 0 .7871.5313 1.4271 1.1862 1.4271.653 0 1.1862-.64 1.1862-1.4271 0-.7907-.5328-1.42906-1.1862-1.42906Zm6.0363-2.73783s-2.1219 1.54591-4.0858-.41975V4.55615s2.7243-.60065 4.0858 2.56806Zm-14.84367 0C5.9908 3.9555 8.71543 4.55615 8.71543 4.55615v2.14831c-1.96566 1.96566-4.08544.41975-4.08544.41975ZM15.04366 0c.4954 0 .8958.4387.8958.98109 0 .54203-.4006.98074-.8958.98074H8.95478c-.49315 0-.89428-.43871-.89428-.98074C8.0605.43871 8.46146 0 8.95478 0h6.08888Z"},mui:{hex:"007FFF",path:"M20.229 15.793a.666.666 0 0 0 .244-.243.666.666 0 0 0 .09-.333l.012-3.858a.666.666 0 0 1 .09-.333.666.666 0 0 1 .245-.243L23 9.58a.667.667 0 0 1 .333-.088.667.667 0 0 1 .333.09.667.667 0 0 1 .244.243.666.666 0 0 1 .089.333v7.014a.667.667 0 0 1-.335.578l-7.893 4.534a.666.666 0 0 1-.662 0l-6.194-3.542a.667.667 0 0 1-.246-.244.667.667 0 0 1-.09-.335v-3.537c0-.004.004-.006.008-.004s.008 0 .008-.005v-.004c0-.003.002-.005.004-.007l5.102-2.93c.004-.003.002-.01-.003-.01a.005.005 0 0 1-.004-.002.005.005 0 0 1-.001-.004l.01-3.467a.667.667 0 0 0-.333-.58.667.667 0 0 0-.667 0L8.912 9.799a.667.667 0 0 1-.665 0l-3.804-2.19a.667.667 0 0 0-.999.577v6.267a.667.667 0 0 1-.332.577.666.666 0 0 1-.332.09.667.667 0 0 1-.333-.088L.336 13.825a.667.667 0 0 1-.246-.244.667.667 0 0 1-.09-.336L.019 2.292a.667.667 0 0 1 .998-.577l7.23 4.153a.667.667 0 0 0 .665 0l7.228-4.153a.666.666 0 0 1 .333-.088.666.666 0 0 1 .333.09.667.667 0 0 1 .244.244.667.667 0 0 1 .088.333V13.25c0 .117-.03.232-.089.334a.667.667 0 0 1-.245.244l-3.785 2.18a.667.667 0 0 0-.245.245.666.666 0 0 0-.089.334.667.667 0 0 0 .09.334.666.666 0 0 0 .247.244l2.088 1.189a.67.67 0 0 0 .33.087.667.667 0 0 0 .332-.089l4.457-2.56Zm.438-9.828a.666.666 0 0 0 .09.335.666.666 0 0 0 .248.244.667.667 0 0 0 .67-.008l2.001-1.2a.666.666 0 0 0 .237-.243.667.667 0 0 0 .087-.329V2.32a.667.667 0 0 0-.091-.335.667.667 0 0 0-.584-.33.667.667 0 0 0-.334.094l-2 1.2a.666.666 0 0 0-.238.243.668.668 0 0 0-.086.329v2.445Z"},bootstrap:{hex:"7952B3",path:"M11.77 11.24H9.956V8.202h2.152c1.17 0 1.834.522 1.834 1.466 0 1.008-.773 1.572-2.174 1.572zm.324 1.206H9.957v3.348h2.231c1.459 0 2.232-.585 2.232-1.685s-.795-1.663-2.326-1.663zM24 11.39v1.218c-1.128.108-1.817.944-2.226 2.268-.407 1.319-.463 2.937-.42 4.186.045 1.3-.968 2.5-2.337 2.5H4.985c-1.37 0-2.383-1.2-2.337-2.5.043-1.249-.013-2.867-.42-4.186-.41-1.324-1.1-2.16-2.228-2.268V11.39c1.128-.108 1.819-.944 2.227-2.268.408-1.319.464-2.937.42-4.186-.045-1.3.968-2.5 2.338-2.5h14.032c1.37 0 2.382 1.2 2.337 2.5-.043 1.249.013 2.867.42 4.186.409 1.324 1.098 2.16 2.226 2.268zm-7.927 2.817c0-1.354-.953-2.333-2.368-2.488v-.057c1.04-.169 1.856-1.135 1.856-2.213 0-1.537-1.213-2.538-3.062-2.538h-4.16v10.172h4.181c2.218 0 3.553-1.086 3.553-2.876z"},sass:{hex:"CC6699",path:"M12 0c6.627 0 12 5.373 12 12s-5.373 12-12 12S0 18.627 0 12 5.373 0 12 0zM9.615 15.998c.175.645.156 1.248-.024 1.792l-.065.18c-.024.061-.052.12-.078.176-.14.29-.326.56-.555.81-.698.759-1.672 1.047-2.09.805-.45-.262-.226-1.335.584-2.19.871-.918 2.12-1.509 2.12-1.509v-.003l.108-.061zm9.911-10.861c-.542-2.133-4.077-2.834-7.422-1.645-1.989.707-4.144 1.818-5.693 3.267C4.568 8.48 4.275 9.98 4.396 10.607c.427 2.211 3.457 3.657 4.703 4.73v.006c-.367.18-3.056 1.529-3.686 2.925-.675 1.47.105 2.521.615 2.655 1.575.436 3.195-.36 4.065-1.649.84-1.261.766-2.881.404-3.676.496-.135 1.08-.195 1.83-.104 2.101.24 2.521 1.56 2.43 2.1-.09.539-.523.854-.674.944-.15.091-.195.12-.181.181.015.09.091.09.21.075.165-.03 1.096-.45 1.141-1.471.045-1.29-1.186-2.729-3.375-2.7-.9.016-1.471.091-1.875.256-.03-.045-.061-.075-.105-.105-1.35-1.455-3.855-2.475-3.75-4.41.03-.705.285-2.564 4.8-4.814 3.705-1.846 6.661-1.335 7.171-.21.733 1.604-1.576 4.59-5.431 5.024-1.47.165-2.235-.404-2.431-.615-.209-.225-.239-.24-.314-.194-.12.06-.045.255 0 .375.12.3.585.825 1.396 1.095.704.225 2.43.359 4.5-.45 2.324-.899 4.139-3.405 3.614-5.505l.073.067z"},drizzle:{hex:"C5F74F",path:"M5.353 11.823a1.036 1.036 0 0 0-.395-1.422 1.063 1.063 0 0 0-1.437.399L.138 16.702a1.035 1.035 0 0 0 .395 1.422 1.063 1.063 0 0 0 1.437-.398l3.383-5.903Zm11.216 0a1.036 1.036 0 0 0-.394-1.422 1.064 1.064 0 0 0-1.438.399l-3.382 5.902a1.036 1.036 0 0 0 .394 1.422c.506.283 1.15.104 1.438-.398l3.382-5.903Zm7.293-4.525a1.036 1.036 0 0 0-.395-1.422 1.062 1.062 0 0 0-1.437.399l-3.383 5.902a1.036 1.036 0 0 0 .395 1.422 1.063 1.063 0 0 0 1.437-.399l3.383-5.902Zm-11.219 0a1.035 1.035 0 0 0-.394-1.422 1.064 1.064 0 0 0-1.438.398l-3.382 5.903a1.036 1.036 0 0 0 .394 1.422c.506.282 1.15.104 1.438-.399l3.382-5.902Z"},supabase:{hex:"3FCF8E",path:"M11.9 1.036c-.015-.986-1.26-1.41-1.874-.637L.764 12.05C-.33 13.427.65 15.455 2.409 15.455h9.579l.113 7.51c.014.985 1.259 1.408 1.873.636l9.262-11.653c1.093-1.375.113-3.403-1.645-3.403h-9.642z"},firebase:{hex:"DD2C00",path:"M19.455 8.369c-.538-.748-1.778-2.285-3.681-4.569-.826-.991-1.535-1.832-1.884-2.245a146 146 0 0 0-.488-.576l-.207-.245-.113-.133-.022-.032-.01-.005L12.57 0l-.609.488c-1.555 1.246-2.828 2.851-3.681 4.64-.523 1.064-.864 2.105-1.043 3.176-.047.241-.088.489-.121.738-.209-.017-.421-.028-.632-.033-.018-.001-.035-.002-.059-.003a7.46 7.46 0 0 0-2.28.274l-.317.089-.163.286c-.765 1.342-1.198 2.869-1.252 4.416-.07 2.01.477 3.954 1.583 5.625 1.082 1.633 2.61 2.882 4.42 3.611l.236.095.071.025.003-.001a9.59 9.59 0 0 0 2.941.568q.171.006.342.006c1.273 0 2.513-.249 3.69-.742l.008.004.313-.145a9.63 9.63 0 0 0 3.927-3.335c1.01-1.49 1.577-3.234 1.641-5.042.075-2.161-.643-4.304-2.133-6.371m-7.083 6.695c.328 1.244.264 2.44-.191 3.558-1.135-1.12-1.967-2.352-2.475-3.665-.543-1.404-.87-2.74-.974-3.975.48.157.922.366 1.315.622 1.132.737 1.914 1.902 2.325 3.461zm.207 6.022c.482.368.99.712 1.513 1.028-.771.21-1.565.302-2.369.273a8 8 0 0 1-.373-.022c.458-.394.869-.823 1.228-1.279zm1.347-6.431c-.516-1.957-1.527-3.437-3.002-4.398-.647-.421-1.385-.741-2.194-.95.011-.134.026-.268.043-.4.014-.113.03-.216.046-.313.133-.689.332-1.37.589-2.025.099-.25.206-.499.321-.74l.004-.008c.177-.358.376-.719.61-1.105l.092-.152-.003-.001c.544-.851 1.197-1.627 1.942-2.311l.288.341c.672.796 1.304 1.548 1.878 2.237 1.291 1.549 2.966 3.583 3.612 4.48 1.277 1.771 1.893 3.579 1.83 5.375-.049 1.395-.461 2.755-1.195 3.933-.694 1.116-1.661 2.05-2.8 2.708-.636-.318-1.559-.839-2.539-1.599.79-1.575.952-3.28.479-5.072zm-2.575 5.397c-.725.939-1.587 1.55-2.09 1.856-.081-.029-.163-.06-.243-.093l-.065-.026c-1.49-.616-2.747-1.656-3.635-3.01-.907-1.384-1.356-2.993-1.298-4.653.041-1.19.338-2.327.882-3.379.316-.07.638-.114.96-.131l.084-.002c.162-.003.324-.003.478 0 .227.011.454.035.677.07.073 1.513.445 3.145 1.105 4.852.637 1.644 1.694 3.162 3.144 4.515z"},bun:{hex:"000000",path:"M12 22.596c6.628 0 12-4.338 12-9.688 0-3.318-2.057-6.248-5.219-7.986-1.286-.715-2.297-1.357-3.139-1.89C14.058 2.025 13.08 1.404 12 1.404c-1.097 0-2.334.785-3.966 1.821a49.92 49.92 0 0 1-2.816 1.697C2.057 6.66 0 9.59 0 12.908c0 5.35 5.372 9.687 12 9.687v.001ZM10.599 4.715c.334-.759.503-1.58.498-2.409 0-.145.202-.187.23-.029.658 2.783-.902 4.162-2.057 4.624-.124.048-.199-.121-.103-.209a5.763 5.763 0 0 0 1.432-1.977Zm2.058-.102a5.82 5.82 0 0 0-.782-2.306v-.016c-.069-.123.086-.263.185-.172 1.962 2.111 1.307 4.067.556 5.051-.082.103-.23-.003-.189-.126a5.85 5.85 0 0 0 .23-2.431Zm1.776-.561a5.727 5.727 0 0 0-1.612-1.806v-.014c-.112-.085-.024-.274.114-.218 2.595 1.087 2.774 3.18 2.459 4.407a.116.116 0 0 1-.049.071.11.11 0 0 1-.153-.026.122.122 0 0 1-.022-.083 5.891 5.891 0 0 0-.737-2.331Zm-5.087.561c-.617.546-1.282.76-2.063 1-.117 0-.195-.078-.156-.181 1.752-.909 2.376-1.649 2.999-2.778 0 0 .155-.118.188.085 0 .304-.349 1.329-.968 1.874Zm4.945 11.237a2.957 2.957 0 0 1-.937 1.553c-.346.346-.8.565-1.286.62a2.178 2.178 0 0 1-1.327-.62 2.955 2.955 0 0 1-.925-1.553.244.244 0 0 1 .064-.198.234.234 0 0 1 .193-.069h3.965a.226.226 0 0 1 .19.07c.05.053.073.125.063.197Zm-5.458-2.176a1.862 1.862 0 0 1-2.384-.245 1.98 1.98 0 0 1-.233-2.447c.207-.319.503-.566.848-.713a1.84 1.84 0 0 1 1.092-.11c.366.075.703.261.967.531a1.98 1.98 0 0 1 .408 2.114 1.931 1.931 0 0 1-.698.869v.001Zm8.495.005a1.86 1.86 0 0 1-2.381-.253 1.964 1.964 0 0 1-.547-1.366c0-.384.11-.76.32-1.079.207-.319.503-.567.849-.713a1.844 1.844 0 0 1 1.093-.108c.367.076.704.262.968.534a1.98 1.98 0 0 1 .4 2.117 1.932 1.932 0 0 1-.702.868Z"},deno:{hex:"70FFAF",path:"M1.105 18.02A11.9 11.9 0 0 1 0 12.985q0-.698.078-1.376a12 12 0 0 1 .231-1.34A12 12 0 0 1 4.025 4.02a12 12 0 0 1 5.46-2.771 12 12 0 0 1 3.428-.23c1.452.112 2.825.477 4.077 1.05a12 12 0 0 1 2.78 1.774 12.02 12.02 0 0 1 4.053 7.078A12 12 0 0 1 24 12.985q0 .454-.036.914a12 12 0 0 1-.728 3.305 12 12 0 0 1-2.38 3.875c-1.33 1.357-3.02 1.962-4.43 1.936a4.4 4.4 0 0 1-2.724-1.024c-.99-.853-1.391-1.83-1.53-2.919a5 5 0 0 1 .128-1.518c.105-.38.37-1.116.76-1.437-.455-.197-1.04-.624-1.226-.829-.045-.05-.04-.13 0-.183a.155.155 0 0 1 .177-.053c.392.134.869.267 1.372.35.66.111 1.484.25 2.317.292 2.03.1 4.153-.813 4.812-2.627s.403-3.609-1.96-4.685-3.454-2.356-5.363-3.128c-1.247-.505-2.636-.205-4.06.582-3.838 2.121-7.277 8.822-5.69 15.032a.191.191 0 0 1-.315.19 12 12 0 0 1-1.25-1.634 12 12 0 0 1-.769-1.404M11.57 6.087c.649-.051 1.214.501 1.31 1.236.13.979-.228 1.99-1.41 2.013-1.01.02-1.315-.997-1.248-1.614.066-.616.574-1.575 1.35-1.635"},nuxt:{hex:"00DC82",path:"M13.4642 19.8295h8.9218c.2834 0 .5618-.0723.8072-.2098a1.5899 1.5899 0 0 0 .5908-.5732 1.5293 1.5293 0 0 0 .216-.783 1.529 1.529 0 0 0-.2167-.7828L17.7916 7.4142a1.5904 1.5904 0 0 0-.5907-.573 1.6524 1.6524 0 0 0-.807-.2099c-.2833 0-.5616.0724-.807.2098a1.5904 1.5904 0 0 0-.5907.5731L13.4642 9.99l-2.9954-5.0366a1.5913 1.5913 0 0 0-.591-.573 1.6533 1.6533 0 0 0-.8071-.2098c-.2834 0-.5617.0723-.8072.2097a1.5913 1.5913 0 0 0-.591.573L.2168 17.4808A1.5292 1.5292 0 0 0 0 18.2635c-.0001.2749.0744.545.216.783a1.59 1.59 0 0 0 .5908.5732c.2454.1375.5238.2098.8072.2098h5.6003c2.219 0 3.8554-.9454 4.9813-2.7899l2.7337-4.5922L16.3935 9.99l4.3944 7.382h-5.8586ZM7.123 17.3694l-3.9083-.0009 5.8586-9.8421 2.9232 4.921-1.9572 3.2892c-.7478 1.1967-1.5972 1.6328-2.9163 1.6328z"},stripe:{hex:"635BFF",path:"M13.976 9.15c-2.172-.806-3.356-1.426-3.356-2.409 0-.831.683-1.305 1.901-1.305 2.227 0 4.515.858 6.09 1.631l.89-5.494C18.252.975 15.697 0 12.165 0 9.667 0 7.589.654 6.104 1.872 4.56 3.147 3.757 4.992 3.757 7.218c0 4.039 2.467 5.76 6.476 7.219 2.585.92 3.445 1.574 3.445 2.583 0 .98-.84 1.545-2.354 1.545-1.875 0-4.965-.921-6.99-2.109l-.9 5.555C5.175 22.99 8.385 24 11.714 24c2.641 0 4.843-.624 6.328-1.813 1.664-1.305 2.525-3.236 2.525-5.732 0-4.128-2.524-5.851-6.594-7.305h.003z"},twilio:{hex:"F22F46",path:"M12 0C5.381-.008.008 5.352 0 11.971V12c0 6.64 5.359 12 12 12 6.64 0 12-5.36 12-12 0-6.641-5.36-12-12-12zm0 20.801c-4.846.015-8.786-3.904-8.801-8.75V12c-.014-4.846 3.904-8.786 8.75-8.801H12c4.847-.014 8.786 3.904 8.801 8.75V12c.015 4.847-3.904 8.786-8.75 8.801H12zm5.44-11.76c0 1.359-1.12 2.479-2.481 2.479-1.366-.007-2.472-1.113-2.479-2.479 0-1.361 1.12-2.481 2.479-2.481 1.361 0 2.481 1.12 2.481 2.481zm0 5.919c0 1.36-1.12 2.48-2.481 2.48-1.367-.008-2.473-1.114-2.479-2.48 0-1.359 1.12-2.479 2.479-2.479 1.361-.001 2.481 1.12 2.481 2.479zm-5.919 0c0 1.36-1.12 2.48-2.479 2.48-1.368-.007-2.475-1.113-2.481-2.48 0-1.359 1.12-2.479 2.481-2.479 1.358-.001 2.479 1.12 2.479 2.479zm0-5.919c0 1.359-1.12 2.479-2.479 2.479-1.367-.007-2.475-1.112-2.481-2.479 0-1.361 1.12-2.481 2.481-2.481 1.358 0 2.479 1.12 2.479 2.481z"},reactquery:{hex:"FF4154",path:"M6.9297 13.6875c.164-.0938.375-.0352.4687.1328l.0625.1055c.4805.8515.9805 1.6601 1.5 2.4258.6133.9023 1.3047 1.8164 2.0743 2.7421a.3455.3455 0 0 1-.0391.4844l-.0742.0664c-2.543 2.2227-4.1914 2.664-4.9532 1.332-.746-1.3046-.4765-3.6718.8086-7.1093a.3437.3437 0 0 1 .1524-.1797ZM17.75 16.3008c.1836-.0313.3594.086.3945.2695l.0196.1016c.6289 3.2851.1875 4.9297-1.3243 4.9297-1.4804 0-3.3593-1.4024-5.6484-4.2032a.3271.3271 0 0 1-.0742-.2226c0-.1875.1562-.3399.3437-.3399h.1211a32.9838 32.9838 0 0 0 2.8086-.0976c1.0703-.086 2.1914-.2305 3.3594-.4375zm.871-6.9766a.3528.3528 0 0 1 .4454-.211l.1016.0352c3.2617 1.1094 4.5039 2.332 3.7187 3.6641-.7656 1.3047-2.9922 2.254-6.6836 2.8477-.082.0117-.168-.004-.2383-.047-.168-.0976-.2265-.3085-.125-.4765l.0625-.1054c.504-.8438.957-1.6836 1.3672-2.5235.4766-.9883.9297-2.0508 1.3516-3.1836zM7.797 8.3398c.082-.0117.168.004.2383.047.168.0976.2265.3085.125.4765l-.0625.1054a34.0882 34.0882 0 0 0-1.3672 2.5235c-.4766.9883-.9297 2.0508-1.3516 3.1836a.3528.3528 0 0 1-.4453.211l-.1016-.0352c-3.2617-1.1094-4.5039-2.332-3.7187-3.6641.7656-1.3047 2.9922-2.254 6.6836-2.8477Zm5.2812-3.9843c2.543-2.2227 4.1914-2.664 4.9532-1.332.746 1.3046.4765 3.6718-.8086 7.1093a.3436.3436 0 0 1-.1524.1797c-.164.0938-.375.0352-.4687-.1328l-.0625-.1055c-.4805-.8515-.9805-1.6601-1.5-2.4258-.6133-.9023-1.3047-1.8164-2.0743-2.7421a.3455.3455 0 0 1 .0391-.4844Zm-5.793-2.082c1.4805 0 3.3633 1.4023 5.6485 4.203a.3488.3488 0 0 1 .0781.2188c-.0039.1914-.1562.3438-.3476.3438l-.1172-.004a34.5835 34.5835 0 0 0-2.8086.1016c-1.0742.086-2.1953.2305-3.3633.4375a.343.343 0 0 1-.3945-.2734l-.0196-.0977c-.629-3.2851-.1876-4.9297 1.3242-4.9297Zm2.8711 5.8124h3.6875a.638.638 0 0 1 .5508.3164l1.8477 3.2188a.6437.6437 0 0 1 0 .6289l-1.8477 3.2227a.638.638 0 0 1-.5507.3164h-3.6875c-.2266 0-.4375-.1211-.547-.3164L7.7579 12.25a.6437.6437 0 0 1 0-.629l1.8516-3.2187c.1093-.1953.3203-.3164.5468-.3164Zm3.2305.793a.638.638 0 0 1 .5508.3164l1.3906 2.4258a.6437.6437 0 0 1 0 .6289l-1.3906 2.4297a.638.638 0 0 1-.5508.3164h-2.7734c-.2266 0-.4375-.1211-.5469-.3164L8.672 12.25a.6437.6437 0 0 1 0-.629l1.3945-2.4257c.1094-.1953.3203-.3164.5469-.3164Zm-.4922.8672h-1.789c-.2266 0-.4336.1172-.547.3164l-.8983 1.5586a.6437.6437 0 0 0 0 .6289l.8984 1.5625a.6317.6317 0 0 0 .5469.3164h1.789a.6317.6317 0 0 0 .547-.3164l.8983-1.5625a.6437.6437 0 0 0 0-.629l-.8984-1.5585c-.1133-.1992-.3203-.3164-.5469-.3164Zm-.4765.8281c.2265 0 .4375.1211.5468.3164l.422.7305c.1132.1953.1132.4375 0 .6289l-.422.7344c-.1093.1953-.3203.3164-.5468.3164h-.836a.6317.6317 0 0 1-.5468-.3164l-.422-.7344c-.1132-.1914-.1132-.4336 0-.629l.422-.7304a.6317.6317 0 0 1 .5468-.3164zm-.418.8164a.548.548 0 0 0-.4727.2735c-.0976.168-.0976.375 0 .5468a.5444.5444 0 0 0 .4727.2696.5444.5444 0 0 0 .4727-.2696c.0976-.1718.0976-.3789 0-.5468A.548.548 0 0 0 12 11.3906Zm-4.4219.5469h.9805M18.9805 7.75c.3906-1.8945.4765-3.3438.2226-4.3984-.1484-.629-.4218-1.1368-.8398-1.5078-.4414-.3907-1-.582-1.625-.582-1.0352 0-2.1211.4726-3.2813 1.3671-.4726.3633-.9648.8047-1.4726 1.3164-.043-.0508-.086-.1015-.1367-.1445-1.4454-1.2852-2.6602-2.082-3.6993-2.3906-.6171-.1836-1.1953-.1993-1.7226-.0235-.5586.1875-1.004.5742-1.3164 1.1172-.5156.8945-.6524 2.0742-.461 3.5274.0782.5898.2149 1.2343.4024 1.9335a1.1187 1.1187 0 0 0-.2149.047C3.008 8.621 1.711 9.2694.9258 10.0155c-.4649.4414-.7695.9375-.8828 1.4805-.1133.5781 0 1.1562.3125 1.6992.5156.8945 1.4648 1.5977 2.8164 2.1563.543.2226 1.1562.4257 1.8437.6093a1.0227 1.0227 0 0 0-.0703.2266c-.3906 1.8906-.4765 3.3438-.2226 4.3945.1484.629.4257 1.1407.8398 1.5078.4414.3907 1 .582 1.625.582 1.0352 0 2.121-.4726 3.2813-1.3632.4765-.3711.9726-.8164 1.4882-1.336a1.2 1.2 0 0 0 .1953.2266c1.4454 1.2852 2.6602 2.082 3.6993 2.3906.6172.1836 1.1953.1993 1.7226.0235.5586-.1875 1.004-.5742 1.3164-1.1172.5157-.8945.6524-2.0742.461-3.5273-.082-.6133-.2227-1.2813-.4258-2.0118a1.2248 1.2248 0 0 0 .2383-.0468c1.828-.6094 3.125-1.2578 3.9101-2.004.4649-.4413.7696-.9374.8828-1.4804.1133-.5781 0-1.1563-.3125-1.6992-.5156-.8946-1.4648-1.5977-2.8164-2.1563-.5586-.2304-1.1953-.4414-1.9062-.625a.8647.8647 0 0 0 .0586-.1953z"},reacthookform:{hex:"EC5990",path:"M10.7754 17.3477H5.8065a.2815.2815 0 1 0 0 .563h4.9689a.2815.2815 0 1 0 0-.563zm7.3195 0h-4.9688a.2815.2815 0 1 0 0 .563h4.9688a.2815.2815 0 0 0 0-.563zm-7.3336-6.475H5.8065a.2815.2815 0 1 0 0 .563h4.9548a.2815.2815 0 1 0 0-.563zm7.3195 0h-4.9547a.2815.2815 0 1 0 0 .563h4.9547a.2815.2815 0 0 0 0-.563zm.5518-9.2001h-4.341a2.4042 2.4042 0 0 0-4.5804 0H5.3674c-1.7103 0-3.0968 1.3864-3.0968 3.0967v16.134C2.2706 22.6135 3.6571 24 5.3674 24h13.2652c1.7103 0 3.0968-1.3865 3.0968-3.0967V4.7693c0-1.7103-1.3865-3.0967-3.0968-3.0967zm-8.7046.563a.2815.2815 0 0 0 .2815-.2224 1.8411 1.8411 0 0 1 3.5979 0 .2815.2815 0 0 0 .2815.2224h1.5146v1.844a.8446.8446 0 0 1-.8446.8446H9.2552a.8446.8446 0 0 1-.8446-.8446v-1.844Zm11.2383 18.6677c0 1.3993-1.1344 2.5337-2.5337 2.5337H5.3674c-1.3993 0-2.5337-1.1344-2.5337-2.5337V4.7693c0-1.3993 1.1344-2.5337 2.5337-2.5337h2.4802v1.844c0 .7774.6302 1.4076 1.4076 1.4076h5.4896c.7774 0 1.4076-.6302 1.4076-1.4076v-1.844h2.4802c1.3993 0 2.5337 1.1344 2.5337 2.5337z"}},df={shipped:"Released",merged:"Merged, not released yet",building:"Being built",designed:"Designed, not built yet",coming:"Coming"};function Fz(){const e=l8(),n=Di({from:"/architecture"}),s=rn(),r=n.view??"map",[a,o]=$.useState(new Set),[c,u]=$.useState(null),[d,p]=$.useState(!1),[f,m]=$.useState(null),y=n.adr?n.adr.startsWith("ADR-")?{kind:"adr",id:n.adr}:{kind:"ticket",id:n.adr}:null,x=O=>void s({to:"/architecture",search:{...(O.view??r)!=="map"?{view:O.view??r}:{},..."pick"in O?O.pick?{adr:O.pick.id}:{}:n.adr?{adr:n.adr}:{}},replace:!0}),k=O=>x({pick:y?.id===O?.id?null:O}),v=e.data?.decisions??[],b=e.data?.tickets??[],N=$.useMemo(()=>Gz(v,b),[v,b]),C=N.cols.length,S=c??C;if($.useEffect(()=>{if(!d)return;const O=setInterval(()=>{u(_=>{const Q=(_??0)+1;return Q>=C?(p(!1),null):Q})},700);return()=>clearInterval(O)},[d,C]),!e.data)return t.jsx("div",{className:"top",children:t.jsx("h1",{children:"Architecture"})});const P=v.filter(O=>N.colOf(O.from)<S),M=P.filter(O=>!O.replacedBy||N.colOf(Mb(v,O.replacedBy))>=S),T=N.cols.slice(0,S).reduce((O,_)=>O+(_.t?.follows.length??0),0),F=f?f.startsWith("ADR-")?{kind:"adr",id:f}:{kind:"ticket",id:f}:y,R=Zz(F,v,b),B=r==="map"||r==="timeline",I=e.data.lessons??[];return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"top",children:[t.jsx("h1",{children:"Architecture"}),t.jsx("span",{className:"note",children:"Every technical choice the squad made, why, and what it shaped. Every new ticket follows the rules in force."})]}),t.jsx("div",{className:"ptabs",role:"tablist",children:[["map","Map"],["timeline","Timeline"],["stack","Stack",e.data.stack.length],["list","All decisions",v.length],["project","Project map"],["lessons","Lessons",I.length]].map(([O,_,Q])=>t.jsxs("button",{role:"tab","aria-selected":r===O,className:r===O?"on":"",onClick:()=>x({view:O}),children:[_," ",Q!==void 0&&t.jsx("span",{className:"n",children:Q})]},O))}),t.jsxs("div",{className:"split",children:[t.jsx("div",{className:"scroll",children:t.jsxs("div",{className:"arch",children:[B&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"arch-stats",children:[t.jsx(hc,{n:M.length,label:"Rules in force",hint:"Every new design must follow these"}),t.jsx(hc,{n:P.length-M.length,label:"Replaced",hint:"Changed by a newer decision"}),t.jsx(hc,{n:M.filter(O=>O.checkedBy?.passing).length,label:"Checked by a test",hint:"Break one and nothing ships"}),t.jsx(hc,{n:T,label:"Times a design followed one",hint:"Past choices shaping new work"})]}),t.jsxs("div",{className:"arch-bar",children:[t.jsxs("button",{className:"btn",onClick:()=>d?p(!1):(u(c===null||c>=C?1:c),p(!0)),children:[d?t.jsx(uu,{size:14}):t.jsx(Wi,{size:14})," ",d?"Pause":"Play the history"]}),t.jsx("input",{type:"range",min:1,max:C,value:S,"aria-label":"Show the project up to this ticket",onChange:O=>{p(!1);const _=Number(O.target.value);u(_>=C?null:_)}}),t.jsx("span",{className:"note mono",style:{minWidth:110},children:S>=C?"Today":`Up to ${N.cols[S-1]?.label??""}`}),t.jsx("span",{className:"grow"}),[...Eu,"Other"].filter(O=>v.some(_=>(_.area??"Other")===O)).map(O=>t.jsxs("button",{className:`chip area-${O.toLowerCase()} ${a.has(O)?"on":""}`,onClick:()=>o(_=>{const Q=new Set(_);return Q.has(O)?Q.delete(O):Q.add(O),Q}),children:[t.jsx("i",{})," ",O]},O))]})]}),r==="map"&&t.jsx(Bz,{decisions:v.filter(O=>a.size===0||a.has(O.area??"Other")),tickets:b,visible:O=>N.colOf(O.from)<S,related:R,picked:y?.id??null,onPick:k,onHover:m}),r==="timeline"&&t.jsx(Hz,{decisions:v,tickets:b,areas:a,shown:S,related:R,picked:y?.id??null,onPick:k,g:N}),B&&t.jsx(Dz,{view:r}),r==="map"&&t.jsx(Vz,{decisions:v,tickets:b,onPick:k}),r==="stack"&&t.jsx(Lz,{data:e.data,picked:y?.id??null,onPick:k}),r==="list"&&t.jsx(Kz,{decisions:v,picked:y?.id??null,onPick:k}),r==="project"&&t.jsxs("div",{style:{maxWidth:820},children:[t.jsxs("p",{className:"note",style:{marginBottom:8,display:"flex",gap:8,alignItems:"center"},children:[t.jsx(U6,{size:15})," The Architect writes this from the code and reads it again after every merge. Every agent reads it first, then opens only the files it needs."]}),t.jsx(zb,{reading:e.data.reading}),e.data.map.map(O=>t.jsxs("div",{className:"maprow",children:[t.jsx("b",{children:O.area}),t.jsx("span",{children:O.detail})]},O.area))]}),r==="lessons"&&t.jsxs("div",{style:{maxWidth:820},children:[t.jsx("p",{className:"note",style:{marginBottom:8},children:"Learned from bugs and reviews. Each lesson makes the next ticket better."}),I.length===0&&t.jsx("p",{className:"note",children:"No lessons yet."}),I.map(O=>t.jsxs("div",{className:"lesson",children:[t.jsx("span",{className:"glyph sm",children:t.jsx(D6,{size:12})}),t.jsxs("span",{children:[O.text," ",t.jsxs("span",{className:"note",children:["From ",O.from]})]}),t.jsx("span",{className:"mono",children:Rs(O.date)})]},O.id))]})]})}),r!=="project"&&r!=="lessons"&&t.jsx(Yz,{pick:y,decisions:v,tickets:b,impact:e.data.impact??[],onPick:k})]})]})}const Ib=[{role:"Language",label:"Language and runtime"},{role:"Framework",label:"App framework"},{role:"Interface",label:"Screens"},{role:"Data",label:"Data"},{role:"Services",label:"Outside services"},{role:"Testing",label:"Testing"},{role:"Tooling",label:"Tooling"}];function Lz({data:e,picked:n,onPick:s}){const r=e.stack.filter(o=>!o.decisions.length&&!o.via).length,a=e.stack.filter(o=>!o.decisions.length&&o.via).length;return t.jsxs("div",{className:"stackv",children:[t.jsx(zb,{reading:e.reading}),t.jsxs("div",{className:"stack-sum",children:[t.jsxs("span",{children:[t.jsx("b",{children:e.stack.length})," technologies in the code"]}),t.jsxs("span",{children:[t.jsx("b",{children:e.stack.length-r-a})," chosen by a saved decision"]}),a>0&&t.jsxs("span",{children:[t.jsx("b",{children:a})," came with one of those"]}),r>0&&t.jsxs("span",{className:"ahead",children:[t.jsx("b",{children:r})," picked while building, no decision yet"]}),t.jsxs("span",{children:[t.jsx("b",{children:e.patterns.length})," design patterns"]})]}),e.stack.length===0&&t.jsx("p",{className:"note",children:"None found yet. The Architect lists them when it reads the code."}),t.jsxs("section",{className:"stack-group",children:[t.jsx("h3",{children:"Technologies"}),t.jsx("div",{className:"techs",children:Ib.flatMap(o=>e.stack.filter(c=>c.role===o.role)).map(o=>t.jsx(_z,{t:o,picked:n,onPick:s},o.name))})]}),t.jsxs("section",{className:"stack-group",children:[t.jsx("h3",{children:"Design patterns the code follows"}),e.patterns.length===0&&t.jsx("p",{className:"note",children:"Not read yet. Press Read the code again, and the Architect lists the patterns a new developer must keep."}),t.jsx("div",{className:"patterns",children:e.patterns.map(o=>t.jsxs("div",{className:"pattern",children:[t.jsx("span",{className:"glyph sm",children:t.jsx(X6,{size:13})}),t.jsxs("div",{children:[t.jsx("b",{children:o.name}),t.jsx("p",{children:o.what}),t.jsxs("div",{className:"where",children:[o.where.map(c=>t.jsx("code",{children:c},c)),o.decision&&t.jsxs("button",{className:`pill click ${n===o.decision?"on":""}`,onClick:()=>s({kind:"adr",id:o.decision}),children:["From ",o.decision]})]})]})]},o.name))})]})]})}function _z({t:e,picked:n,onPick:s}){const r=e.icon?Mz[e.icon]:void 0;return t.jsxs("div",{className:`tech ${e.decisions.some(a=>a===n)?"picked":""}`,children:[t.jsxs("div",{className:"tech-head",children:[t.jsx("span",{className:"logo",style:r?{"--brand":`#${r.hex}`}:void 0,children:r?t.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",className:qz(r.hex)?"ink":"",children:t.jsx("path",{d:r.path})}):t.jsx("span",{className:"mono",children:e.name.slice(0,2)})}),t.jsxs("span",{className:"tech-name",children:[t.jsx("b",{children:e.name}),e.version&&t.jsxs("span",{className:"mono",children:["v",e.version]})]}),t.jsx("span",{className:"tech-role",children:Ib.find(a=>a.role===e.role)?.label})]}),t.jsx("p",{className:e.why?"":"note",children:e.why??"Not explained yet. The Architect fills this in when it reads the code."}),t.jsx("div",{className:"tech-foot",children:e.decisions.length?e.decisions.map(a=>t.jsxs("button",{className:`pill click ${n===a?"on":""}`,onClick:()=>s({kind:"adr",id:a}),children:["Chosen in ",a]},a)):e.via?e.via.decisions.map(a=>t.jsxs("button",{className:`pill click ${n===a?"on":""}`,onClick:()=>s({kind:"adr",id:a}),title:`Choosing ${e.via.name} chose ${e.name} too`,children:["Comes with ",e.via.name," · ",a]},a)):t.jsx(Oz,{t:e})})]})}function Oz({t:e}){const n=pe(),s=(a,o)=>n.mutate({path:"/api/v1/architecture/decide",body:{tech:e.name,do:a},done:o}),r=e.draft;if(r?.status==="writing"||n.isPending&&!r)return t.jsxs("span",{className:"pill nodecision",children:[t.jsx(jn,{size:12,className:"spin"})," The Architect is writing it"]});if(r?.status==="ready"&&r.decision){const a=r.decision;return t.jsxs("div",{className:"techdraft",children:[t.jsx("span",{className:"lbl",children:"Decision for you to approve"}),t.jsx("b",{children:a.title}),t.jsxs("p",{children:[t.jsx("span",{className:"note",children:"Chosen:"})," ",a.chosen]}),t.jsx("p",{children:a.why}),a.options.filter(o=>o!==a.chosen).length>0&&t.jsxs("p",{className:"note",children:["Also looked at: ",a.options.filter(o=>o!==a.chosen).join("; ")]}),t.jsxs("div",{className:"row",children:[t.jsxs("button",{className:"btn sm pri",disabled:n.isPending,onClick:()=>s("approve","Saved as a decision. Every new ticket follows it now."),children:[t.jsx(xe,{size:13})," Approve"]}),t.jsx("button",{className:"btn sm",disabled:n.isPending,onClick:()=>s("discard"),children:"Discard"})]})]})}return t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"pill nodecision",title:r?.status==="failed"?`The last try stopped: ${r.error??""}`:"The Builder added it while building; nobody wrote down why.",children:r?.status==="failed"?"Writing stopped, try again":"Picked while building"}),t.jsx("button",{className:"btn sm",onClick:()=>s("write",`The Architect is writing a decision for ${e.name}.`),children:"Save as a decision"})]})}function qz(e){const n=parseInt(e,16);return(n>>16&255)*.299+(n>>8&255)*.587+(n&255)*.114<60}function zb({reading:e}){const n=pe(),s=e?.status==="pending"||e?.status==="running"||n.isPending;return t.jsxs("div",{className:`reading ${e?.status==="failed"?"bad":""}`,children:[s?t.jsx(jn,{size:15,className:"spin"}):t.jsx(Mi,{size:15}),t.jsx("span",{children:s?"The Architect is reading the code. This takes a minute or two.":e?.status==="failed"?`The last read stopped: ${e.error??"unknown error"}`:e?.at?`Read from the code ${nn(e.at)}. It is read again after every merge.`:"Not read from the code yet."}),t.jsx("span",{className:"grow"}),t.jsxs("button",{className:"btn sm",disabled:s,onClick:()=>n.mutate({path:"/api/v1/architecture/read",done:"The Architect is reading the code."}),children:[t.jsx(Mi,{size:13})," Read the code again"]})]})}function hc({n:e,label:n,hint:s}){return t.jsxs("div",{className:"arch-stat",title:s,children:[t.jsx("b",{children:e}),t.jsx("span",{children:n}),t.jsx("small",{children:s})]})}function Dz({view:e}){return e==="map"?t.jsxs("div",{className:"arch-legend note",children:[t.jsxs("span",{children:[t.jsx("i",{className:"lg arrow"})," Built on"]}),t.jsxs("span",{children:[t.jsx("i",{className:"lg arrow replaces"})," Replaces"]}),t.jsxs("span",{children:[t.jsx("i",{className:"lg chip made"})," Ticket that made it"]}),t.jsxs("span",{children:[t.jsx("i",{className:"lg chip"})," Ticket that followed it"]}),t.jsxs("span",{children:[t.jsx("i",{className:"lg chip ahead"})," Will follow it, not built yet"]}),t.jsxs("span",{children:[t.jsx(xe,{size:12,strokeWidth:3})," Checked by a test"]})]}):t.jsxs("div",{className:"arch-legend note",children:[t.jsxs("span",{children:[t.jsx("i",{className:"lg node"})," Made the decision"]}),t.jsxs("span",{children:[t.jsx("i",{className:"lg dot"})," Its design followed it"]}),t.jsxs("span",{children:[t.jsx("i",{className:"lg dot open"})," Will follow it, not built yet"]}),t.jsxs("span",{children:[t.jsx("i",{className:"lg link"})," Built on an older one"]}),t.jsxs("span",{children:[t.jsx("i",{className:"lg link replaces"})," Replaces an older one"]})]})}const Ci=112,up=18,Ua=16,t2=34;function Bz({decisions:e,tickets:n,visible:s,related:r,picked:a,onPick:o,onHover:c}){const[u,d]=$.useState(1100),p=$.useRef(null);$.useEffect(()=>{const R=p.current;if(!R)return;const B=new ResizeObserver(()=>d(R.clientWidth));return B.observe(R),()=>B.disconnect()},[]);const f=new Set(e.map(R=>R.id)),m=R=>[...R.buildsOn??[],...R.replaces?[R.replaces]:[]].filter(B=>f.has(B)),y=new Map,x=(R,B=new Set)=>{if(y.has(R.id))return y.get(R.id);if(B.has(R.id))return 0;B.add(R.id);const I=m(R).map(_=>e.find(Q=>Q.id===_)),O=I.length?1+Math.max(...I.map(_=>x(_,B))):0;return y.set(R.id,O),O},k=[...Eu,"Other"],v=[];for(const R of e)(v[x(R)]??=[]).push(R);const b=v.length>4?30:46,N=Math.max(150,Math.min(270,(u-Ua*2-Math.max(0,v.length-1)*b)/Math.max(1,v.length)));for(const R of v)R?.sort((B,I)=>k.indexOf(B.area??"Other")-k.indexOf(I.area??"Other")||n2(B.id)-n2(I.id));const C=Math.max(1,...v.map(R=>R?.length??0)),S=t2+C*(Ci+up)+Ua,P=new Map;v.forEach((R,B)=>{const I=(C-(R?.length??0))*(Ci+up)/2;R?.forEach((O,_)=>P.set(O.id,{x:Ua+B*(N+b),y:t2+I+_*(Ci+up)}))});const M=Ua*2+v.length*N+Math.max(0,v.length-1)*b,T=R=>r!==null&&!r.has(R),F=["Starting points","Built on them","One more level","And on those","And further"];return t.jsx("div",{className:"dmap",ref:p,onMouseLeave:()=>c(null),children:t.jsxs("div",{className:"dmap-canvas",style:{width:M,height:S},children:[v.map((R,B)=>t.jsx("span",{className:"dmap-layer",style:{left:Ua+B*(N+b),width:N},children:F[B]??`Level ${B+1}`},B)),t.jsxs("svg",{width:M,height:S,className:"dmap-edges",children:[t.jsxs("defs",{children:[t.jsx("marker",{id:"arr",viewBox:"0 0 10 10",refX:"9",refY:"5",markerWidth:"7",markerHeight:"7",orient:"auto-start-reverse",children:t.jsx("path",{d:"M0 1 L9 5 L0 9 z",className:"arrhead"})}),t.jsx("marker",{id:"arr-r",viewBox:"0 0 10 10",refX:"9",refY:"5",markerWidth:"7",markerHeight:"7",orient:"auto-start-reverse",children:t.jsx("path",{d:"M0 1 L9 5 L0 9 z",className:"arrhead replaces"})})]}),e.flatMap(R=>{const B=P.get(R.id);return!B||!s(R)?[]:[...(R.buildsOn??[]).map(O=>({p:O,kind:"built"})),...R.replaces?[{p:R.replaces,kind:"replaces"}]:[]].map(({p:O,kind:_})=>{const Q=P.get(O),q=e.find(D=>D.id===O);if(!Q||!q||!s(q))return null;const K=Q.x+N,ce=Q.y+Ci/2,H=B.x-2,V=B.y+Ci/2,ne=Math.max(40,(H-K)/2),A=r!==null&&r.has(R.id)&&r.has(O);return t.jsx("path",{className:`edge ${_} ${T(R.id)||T(O)?"off":""} ${A?"lit":""}`,d:`M${K} ${ce} C${K+ne} ${ce}, ${H-ne} ${V}, ${H} ${V}`,markerEnd:`url(#${_==="replaces"?"arr-r":"arr"})`},`${O}-${R.id}-${_}`)})})]}),e.map(R=>{const B=P.get(R.id),I=R.tickets.filter(q=>q!==R.from),O=n.filter(q=>(q.state==="designed"||q.state==="coming")&&q.follows.includes(R.id)&&!I.includes(q.id)),_=[R.from==="Project scan"?"Scan":R.from,...I],Q=_.length+O.length-6;return t.jsxs("button",{className:`dcard area-${(R.area??"Other").toLowerCase()} ${s(R)?"":"later"} ${T(R.id)?"off":""} ${a===R.id?"picked":""} ${R.replacedBy?"old":""}`,style:{left:B.x,top:B.y,width:N,height:Ci},onClick:()=>o({kind:"adr",id:R.id}),onMouseEnter:()=>c(R.id),children:[t.jsxs("span",{className:"dhead",children:[t.jsx("i",{}),t.jsx("span",{className:"mono",children:R.id}),t.jsx("span",{className:"darea",children:R.area??"Other"}),R.checkedBy?.passing&&t.jsx(xe,{size:13,strokeWidth:3,className:"dtest","aria-label":"Checked by a test"})]}),t.jsx("b",{className:"dtitle",children:R.title}),t.jsx("span",{className:"dchips",children:R.replacedBy?t.jsxs("span",{className:"dchip ahead",children:["Replaced by ",R.replacedBy]}):t.jsxs(t.Fragment,{children:[_.slice(0,6).map((q,K)=>t.jsx("span",{className:`dchip ${K===0?"made":""}`,title:K===0?"Made this decision":"Its design followed it",children:q},q)),O.slice(0,Math.max(0,6-_.length)).map(q=>t.jsx("span",{className:"dchip ahead",title:"Designed, not built yet: will follow it",children:q.id},q.id)),Q>0&&t.jsxs("span",{className:"dchip",children:["+",Q]})]})})]},R.id)})]})})}const dp=30,Wz=26,pc=250,Uz=62;function Hz({decisions:e,areas:n,shown:s,related:r,picked:a,onPick:o,g:c}){const[u,d]=$.useState(1e3),p=$.useRef(null);$.useEffect(()=>{const T=p.current;if(!T)return;const F=new ResizeObserver(()=>d(T.clientWidth));return F.observe(T),()=>F.disconnect()},[]);const f=c.cols.length,m=Math.max(40,Math.min(64,(u-pc-24)/Math.max(1,f))),y=c.rows.filter(T=>n.size===0||n.has(T.area)),x=new Map;let k=Uz+8,v="";const b=[];for(const T of y)T.area!==v&&(v=T.area,k+=Wz,b.push({area:T.area,y:k-18})),x.set(T.d.id,k),k+=dp;const N=k+12,C=pc+f*m+16,S=T=>pc+T*m+m/2,P=T=>T<s,M=T=>r!==null&&!r.has(T);return t.jsx("div",{className:"arch-graph",ref:p,children:t.jsxs("svg",{width:C,height:N,role:"img","aria-label":"Decisions over time, and the tickets that followed them",children:[c.cols.map((T,F)=>t.jsxs("g",{className:`col state-${T.t?.state??"scan"} ${P(F)?"":"later"} ${M(T.key)?"dim":""}`,onClick:()=>T.t&&o({kind:"ticket",id:T.key}),children:[t.jsx("rect",{className:"colbg",x:pc+F*m+2,y:6,width:m-4,height:N-12,rx:10}),t.jsx("text",{className:"colid",x:S(F),y:26,textAnchor:"middle",children:T.label}),t.jsx("circle",{className:"colstate",cx:S(F),cy:42,r:4}),t.jsx("title",{children:T.t?`${T.t.id} · ${T.t.title}
634
- ${df[T.t.state]}`:"What the Architect found when it first read the project"})]},T.key)),b.map(T=>t.jsx("text",{className:`lane area-${T.area.toLowerCase()}`,x:14,y:T.y,children:T.area.toUpperCase()},T.area)),y.map(T=>{const F=x.get(T.d.id),R=c.colOf(T.d.from);if(!P(R))return null;const B=T.d.replacedBy?c.colOf(Mb(e,T.d.replacedBy)):f-1,I=Math.min(B,s-1),O=`track area-${T.area.toLowerCase()} ${M(T.d.id)?"dim":""} ${a===T.d.id?"picked":""}`;return t.jsxs("g",{className:O,onClick:()=>o({kind:"adr",id:T.d.id}),children:[t.jsx("rect",{className:"hit",x:0,y:F-dp/2,width:C,height:dp}),t.jsxs("text",{className:"name",x:14,y:F+4,children:[t.jsx("tspan",{className:"rid",children:T.d.id})," ",Xz(T.d.title,28)]}),t.jsx("line",{className:`rail ${T.d.replacedBy&&B<s?"gone":""}`,x1:S(R),x2:S(I)+(T.d.replacedBy?0:m/2),y1:F,y2:F}),c.cols.map((_,Q)=>Q>R&&P(Q)&&_.t?.follows.includes(T.d.id)?t.jsx("circle",{className:`dot ${_.t.state==="designed"||_.t.state==="coming"?"open":""}`,cx:S(Q),cy:F,r:5,children:t.jsx("title",{children:`${_.t.id} followed ${T.d.id}`})},_.key):null),t.jsx("circle",{className:`node ${T.d.replacedBy?"old":""}`,cx:S(R),cy:F,r:8}),T.d.checkedBy?.passing&&t.jsx("path",{className:"tick",d:`M${S(R)-3.5} ${F} l2.5 2.6 l4.8 -5`}),t.jsx("title",{children:`${T.d.id} · ${T.d.title}
635
- Chosen: ${T.d.chosen}`})]},T.d.id)}),y.flatMap(T=>{const F=x.get(T.d.id),R=c.colOf(T.d.from);return P(R)?[...(T.d.buildsOn??[]).map(I=>({b:I,kind:"built"})),...T.d.replaces?[{b:T.d.replaces,kind:"replaces"}]:[]].map(({b:I,kind:O})=>{const _=x.get(I);if(_===void 0)return null;const Q=F>_?1:-1;return t.jsxs("g",{className:`link ${O} ${M(T.d.id)||M(I)?"dim":""}`,children:[t.jsx("path",{d:`M${S(R)} ${_+6*Q} L${S(R)} ${F-9*Q}`}),t.jsx("circle",{cx:S(R),cy:_,r:3.2})]},`${T.d.id}-${I}-${O}`)}):[]})]})})}function Vz({decisions:e,tickets:n,onPick:s}){return t.jsxs("div",{className:"arch-cards",children:[t.jsxs("div",{className:"arch-card",children:[t.jsx("h4",{children:"What a new ticket inherits today"}),t.jsx("p",{className:"note",children:"The Architect, the Builder and the Reviewer read all of these before they start."}),[...Eu,"Other"].map(r=>{const a=e.filter(o=>!o.replacedBy&&(o.area??"Other")===r);return a.length?t.jsxs("div",{className:`inherit area-${r.toLowerCase()}`,children:[t.jsxs("b",{children:[t.jsx("i",{})," ",r]}),a.map(o=>t.jsxs("button",{onClick:()=>s({kind:"adr",id:o.id}),children:[t.jsx("span",{className:"mono",children:o.id})," ",o.title]},o.id))]},r):null})]}),t.jsxs("div",{className:"arch-card",children:[t.jsx("h4",{children:"Coming next"}),t.jsx("p",{className:"note",children:"Tickets not built yet, and the past decisions that will shape them."}),n.filter(r=>r.state==="designed"||r.state==="coming").map(r=>t.jsxs("div",{className:"coming",children:[t.jsxs("button",{onClick:()=>s({kind:"ticket",id:r.id}),children:[t.jsx("span",{className:"mono",children:r.id})," ",r.title]}),t.jsx("span",{className:"pills",children:r.follows.length?r.follows.map(a=>t.jsx("button",{className:"pill click",onClick:()=>s({kind:"adr",id:a}),children:a},a)):t.jsxs("span",{className:"note",children:["Not designed yet. Will read the ",e.filter(a=>!a.replacedBy).length," rules in force."]})})]},r.id))]})]})}function Kz({decisions:e,picked:n,onPick:s}){return t.jsxs("table",{className:"table",children:[t.jsx("thead",{children:t.jsxs("tr",{children:[t.jsx("th",{style:{width:90},children:"ID"}),t.jsx("th",{children:"Decision"}),t.jsx("th",{style:{width:110},children:"Area"}),t.jsx("th",{style:{width:120},children:"From"}),t.jsx("th",{style:{width:150},children:"Checked by"})]})}),t.jsx("tbody",{children:[...e].reverse().map(r=>t.jsxs("tr",{className:`click ${n===r.id?"on":""}`,onClick:()=>s({kind:"adr",id:r.id}),children:[t.jsx("td",{className:"mono",children:r.id}),t.jsxs("td",{style:{fontWeight:n===r.id?600:500,color:r.replacedBy?"var(--dim)":void 0},children:[r.replacedBy?t.jsx("s",{children:r.title}):r.title," ",r.replacedBy&&t.jsxs("span",{className:"pill wait",children:["Replaced by ",r.replacedBy]})]}),t.jsx("td",{children:t.jsxs("span",{className:`areatag area-${(r.area??"Other").toLowerCase()}`,children:[t.jsx("i",{})," ",r.area??"Other"]})}),t.jsx("td",{style:{color:"var(--muted)",fontSize:13},children:r.from}),t.jsx("td",{children:r.checkedBy?r.checkedBy.passing?t.jsxs("span",{className:"pill ok",children:[t.jsx(xe,{size:13,strokeWidth:2.5})," A ",r.checkedBy.kind]}):t.jsx("span",{className:"pill you",children:"Test being written"}):t.jsx("span",{className:"pill wait",children:"Not checkable"})})]},r.id))})]})}function Yz({pick:e,decisions:n,tickets:s,impact:r,onPick:a}){const o=m=>t.jsx("button",{className:"pill click",onClick:()=>a({kind:"adr",id:m}),children:m},m),c=m=>{const y=s.find(x=>x.id===m);return t.jsx("button",{className:`pill click st-${y?.state??"shipped"}`,title:y?`${y.title} · ${df[y.state]}`:m,onClick:()=>a({kind:"ticket",id:m}),children:m},m)};if(e?.kind==="ticket"){const m=s.find(y=>y.id===e.id);return m?t.jsxs("aside",{className:"sidepanel arch-side",children:[t.jsxs("span",{className:"note mono",children:[m.id," · ",df[m.state],m.release?` · ${m.release}`:""]}),t.jsx("h3",{children:m.title}),t.jsx("div",{className:"lbl",children:"Decision it made"}),m.made?t.jsxs("p",{style:{fontSize:13.5},children:[o(m.made)," ",n.find(y=>y.id===m.made)?.title]}):t.jsx("p",{className:"note",children:"None. It worked inside the rules it had."}),t.jsx("div",{className:"lbl",children:"Past decisions its design followed"}),m.follows.length?t.jsx("div",{className:"pills",children:m.follows.map(o)}):t.jsx("p",{className:"note",children:m.state==="coming"?"Not designed yet. When it is, it reads every rule in force.":"None recorded."}),t.jsx("p",{style:{marginTop:18},children:t.jsx(Te,{to:"/board",search:{ticket:m.id},className:"btn",children:"Open the ticket"})})]}):t.jsx("aside",{className:"sidepanel arch-side",children:t.jsx("p",{className:"note",children:"That ticket is not on this board."})})}const u=e?.kind==="adr"?n.find(m=>m.id===e.id):void 0;if(!u)return t.jsxs("aside",{className:"sidepanel arch-side",children:[t.jsx("span",{className:"note mono",children:"HOW IT WORKS"}),t.jsx("h3",{children:"Every choice is remembered"}),t.jsx("p",{style:{fontSize:13.5,marginTop:8},children:"When a ticket needs a technical choice, the Architect writes it with the options and the why. You approve it with the design. From then on it is a rule: every later ticket reads it, and the tickets whose design used it are linked here."}),t.jsx("p",{style:{fontSize:13.5,marginTop:10},children:"A new decision can build on an older one, or replace it. A replaced decision stops being a rule, but its history stays."}),t.jsx("p",{className:"note",style:{marginTop:14},children:"Point at a decision to light up what it touched. Click it for the full story. Press Play to watch the project grow."})]});const d=n.filter(m=>m.buildsOn?.includes(u.id)),p=u.tickets.filter(m=>m!==u.from),f=s.filter(m=>(m.state==="designed"||m.state==="coming")&&m.follows.includes(u.id)&&!p.includes(m.id));return t.jsxs("aside",{className:"sidepanel arch-side",children:[t.jsxs("span",{className:"note mono",children:[u.id," · ",u.area??"Other"," · ",u.proposed?"found in the code, not approved yet":`approved by ${u.approvedBy}`," · ",Rs(u.date)]}),t.jsx("h3",{children:u.title}),u.proposed&&t.jsxs("div",{className:"box",style:{borderColor:"var(--you-line)",background:"var(--you-soft)",marginTop:8},children:[t.jsx("b",{children:"Proposed, not a rule yet."})," It becomes one when you approve the ",t.jsx(Te,{to:"/overview",children:"Overview"}),"."]}),u.replacedBy&&t.jsxs("div",{className:"box",style:{borderColor:"var(--you-line)",background:"var(--you-soft)",marginTop:8},children:[t.jsx("b",{children:"No longer a rule."})," Replaced by ",o(u.replacedBy),"."]}),t.jsx("div",{className:"lbl",children:"Chosen"}),t.jsx("p",{style:{fontSize:13.5,fontWeight:600},children:u.chosen}),t.jsx("div",{className:"lbl",children:"Why"}),t.jsx("p",{style:{fontSize:13.5},children:u.why}),u.options.length>1&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"lbl",children:"Also looked at"}),u.options.filter(m=>m!==u.chosen).map(m=>t.jsx("p",{className:"note",style:{fontSize:13},children:m},m))]}),t.jsx("div",{className:"lbl",children:"Where it came from"}),t.jsxs("div",{className:"pills",style:{alignItems:"center"},children:[u.from==="Project scan"?t.jsx("span",{className:"pill",children:"Project scan"}):c(u.from),(u.buildsOn??[]).length>0&&t.jsx("span",{className:"note",children:"built on"}),(u.buildsOn??[]).map(o),u.replaces&&t.jsx("span",{className:"note",children:"replaces"}),u.replaces&&o(u.replaces)]}),t.jsx("div",{className:"lbl",children:"What it shaped"}),p.length||d.length?t.jsxs(t.Fragment,{children:[p.length>0&&t.jsx("p",{className:"note",style:{marginBottom:6},children:"Tickets whose design followed it"}),t.jsx("div",{className:"pills",children:p.map(c)}),d.length>0&&t.jsx("p",{className:"note",style:{margin:"10px 0 6px"},children:"Decisions built on it"}),t.jsx("div",{className:"pills",children:d.map(m=>o(m.id))})]}):t.jsx("p",{className:"note",children:"Nothing yet. Every new ticket reads it."}),f.length>0&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"lbl",children:"Still ahead"}),t.jsx("p",{className:"note",style:{marginBottom:6},children:"Designed, not built yet. They will follow it."}),t.jsx("div",{className:"pills",children:f.map(m=>c(m.id))})]}),t.jsx(Qz,{d:u,check:r.find(m=>m.adr===u.id),tk:c}),t.jsx("div",{className:"lbl",children:"Checked by"}),u.checkedBy?t.jsxs("div",{className:"box",children:[t.jsx("b",{style:{color:u.checkedBy.passing?"var(--accent)":"var(--you-ink)"},children:u.checkedBy.passing?"Passing":"Being written"})," ",t.jsx("span",{className:"mono",style:{fontSize:12},children:u.checkedBy.name}),t.jsx("p",{className:"note",style:{marginTop:4},children:"If someone breaks this decision, the checks fail and nothing ships."})]}):t.jsx("p",{className:"note",children:"A fact about the project, nothing to test."})]})}function Qz({d:e,check:n,tk:s}){const r=pe();if(e.replacedBy)return null;const a=n?.status==="pending"||n?.status==="running"||r.isPending,o=()=>r.mutate({path:"/api/v1/architecture/impact",body:{adr:e.id},done:`The Architect is checking the open tickets against ${e.id}.`});return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"lbl",children:"Tickets planned before it"}),a?t.jsxs("p",{className:"note",style:{display:"flex",gap:8,alignItems:"center"},children:[t.jsx(jn,{size:13,className:"spin"})," The Architect is checking the open tickets."]}):n?.status==="done"?t.jsxs(t.Fragment,{children:[t.jsx("p",{className:"note",style:{marginBottom:6},children:n.checked?.length?`Checked ${n.checked.length} open ${n.checked.length===1?"ticket":"tickets"} ${n.at?nn(n.at):""}. ${n.affected?.length?"These need a change, waiting for you:":"None need a change."}`:"No open ticket was planned before it."}),t.jsx("div",{className:"pills",children:(n.affected??[]).map(s)}),t.jsx("button",{className:"btn sm quiet",style:{marginTop:8},onClick:o,children:"Check again"})]}):t.jsxs(t.Fragment,{children:[t.jsx("p",{className:"note",style:{marginBottom:8},children:n?.status==="failed"?`The last check stopped: ${n.error??""}`:"Not checked yet. Plans written before it may still do it the old way."}),t.jsx("button",{className:"btn sm",onClick:o,children:"Check open tickets"})]})]})}function Gz(e,n){const s=[];e.some(c=>!n.some(u=>u.id===c.from))&&s.push({key:"scan",label:"Scan"});for(const c of n)s.push({key:c.id,label:c.id,t:c});const r=c=>{const u=s.findIndex(d=>d.key===c);return u<0?0:u},a=[...Eu,"Other"],o=e.map(c=>({d:c,area:c.area??"Other"})).sort((c,u)=>a.indexOf(c.area)-a.indexOf(u.area)||r(c.d.from)-r(u.d.from));return{cols:s,rows:o,colOf:r}}function Mb(e,n){return e.find(s=>s.id===n)?.from??""}function Zz(e,n,s){if(!e)return null;const r=new Set([e.id]),a=u=>[...u.buildsOn??[],...u.replaces?[u.replaces]:[]];if(e.kind==="ticket"){const u=s.find(d=>d.id===e.id);for(const d of u?.follows??[])r.add(d);return u?.made&&r.add(u.made),r}const o=[e.id];for(;o.length;){const u=o.pop(),d=n.find(p=>p.id===u);for(const p of d?a(d):[])r.has(p)||(r.add(p),o.push(p))}const c=[e.id];for(;c.length;){const u=c.pop();for(const d of n)a(d).includes(u)&&!r.has(d.id)&&(r.add(d.id),c.push(d.id))}for(const u of[...r]){const d=n.find(p=>p.id===u);if(d&&u===e.id)for(const p of d.tickets)r.add(p);d&&r.add(d.from)}for(const u of s)u.follows.includes(e.id)&&r.add(u.id);return r}function Xz(e,n){return e.length>n?`${e.slice(0,n-1).trimEnd()}…`:e}function n2(e){return Number(e.replace(/\D/g,""))||0}function zm(){return Pe({queryKey:["sandbox"],queryFn:()=>Ee("/api/v1/sandbox")})}function Jz(){const e=zm(),n=e.data?.note;return t.jsxs(t.Fragment,{children:[n&&t.jsxs("div",{className:"toolrow",children:[t.jsx("span",{className:"logo",children:t.jsx(jk,{size:18})}),t.jsxs("span",{style:{minWidth:0},children:[t.jsx("b",{children:n.title}),t.jsx("br",{}),t.jsx("span",{className:"note",children:n.text})]}),t.jsx("span",{className:"pill wait",children:"Less protected"})]}),(e.data?.tools??[]).map(s=>t.jsxs("div",{className:"toolrow",children:[t.jsx("span",{className:"logo",children:s.available?t.jsx(fx,{size:18}):t.jsx(mx,{size:18})}),t.jsxs("span",{style:{minWidth:0},children:[t.jsx("b",{children:"Sandbox for the Builder and Tester"}),t.jsx("br",{}),s.available?t.jsxs("span",{className:"note",children:["Their commands run in ",s.why,": they write only in the ticket's copy, the proof folder and temp folders, reach only package registries and the websites you allow in Settings, and never read your keys, sign-ins or .env files. Packages for .NET, Java and Ruby go into the ticket's own download folder, never into your own caches; it goes when the ticket is released or deleted, so a ticket's first build downloads them again."]}):t.jsxs("span",{className:"note",children:["Not available on this computer: ",s.why,". The Builder and Tester run as before, kept in their lane by squad-kit's own checks.",s.fix?` To turn it on: ${s.fix}.`:""]})]}),t.jsx("span",{className:`pill ${s.available?"ok":"wait"}`,children:s.available?"On":"Not available"})]},s.tool)),e.data?.guard&&t.jsxs("div",{className:"toolrow",children:[t.jsx("span",{className:"logo",children:e.data.guard.on?t.jsx(fx,{size:18}):t.jsx(mx,{size:18})}),t.jsxs("span",{style:{minWidth:0},children:[t.jsx("b",{children:"Guard for the project's own commands"}),t.jsx("br",{}),e.data.guard.on?t.jsxs("span",{className:"note",children:["The project's own tests, setup and app run in ",e.data.guard.why,": they work normally and can reach the internet for packages and tests, but they cannot read your keys, sign-ins, squad-kit's own folder or the project's .env files. An engineer can allow a file they truly need in Settings."]}):t.jsxs("span",{className:"note",children:["Not available on this computer: ",e.data.guard.why,". The project's tests, setup and app run as before.",e.data.guard.fix?` To turn it on: ${e.data.guard.fix}.`:""]})]}),t.jsx("span",{className:`pill ${e.data.guard.on?"ok":"wait"}`,children:e.data.guard.on?"On":"Not available"})]}),e.data&&e.data.tools.some(s=>!s.available)&&t.jsx("div",{style:{marginTop:8},children:t.jsx(se,{text:"squad doctor"})})]})}function eM({hosts:e}){const n=pe(),s=zm(),[r,a]=$.useState(""),o=(p,f)=>n.mutate({path:"/api/v1/settings",method:"PUT",body:{allowedHosts:p},done:f},{onSuccess:()=>a("")}),c=()=>{const p=r.trim();p&&o([...e,p],`The squad may reach ${p} from its next step`)},u=s.data?.tools.length?s.data.tools.every(p=>!p.available):!1,d=s.data?.note;return t.jsxs(t.Fragment,{children:[d&&t.jsxs("div",{className:"maprow",children:[t.jsx("b",{children:d.title}),t.jsx("span",{className:"note",children:d.text})]}),t.jsxs("div",{className:"maprow",children:[t.jsx("b",{style:{paddingTop:4},children:"Websites the squad may reach"}),t.jsxs("span",{style:{display:"flex",flexDirection:"column",gap:8,minWidth:0},children:[t.jsxs("span",{className:"note",children:["The Builder and Tester can download packages from npm, PyPI, Maven and the other package registries, and nothing else. Allow a website here when the project needs one, for example your company's package server. The whole team shares this list.",u?" This computer has no sandbox, so here they can reach any website.":""]}),e.length>0&&t.jsx("span",{className:"pills",children:e.map(p=>t.jsxs("span",{className:"pill mono",children:[p,t.jsx("button",{className:"linkbtn","aria-label":`Stop allowing ${p}`,title:`Stop allowing ${p}`,disabled:n.isPending,onClick:()=>o(e.filter(f=>f!==p),`The squad no longer reaches ${p}`),children:t.jsx(Xe,{size:12})})]},p))}),t.jsxs("span",{style:{display:"flex",gap:6,alignItems:"center",flexWrap:"wrap"},children:[t.jsx("input",{className:"input mono",style:{fontSize:13,flex:"1 1 200px",minWidth:0},value:r,placeholder:"packages.example.com","aria-label":"A website to allow",onChange:p=>a(p.target.value),onKeyDown:p=>p.key==="Enter"&&c()}),t.jsx("button",{className:"btn sm",disabled:!r.trim()||n.isPending,onClick:c,children:"Allow"})]}),t.jsx(se,{text:`squad config set hosts ${[...e,r.trim()].filter(Boolean).join(" ")||"nexus.example.com"}`})]})]}),t.jsx(tM,{})]})}function tM(){const e=pe(),s=zm().data?.guard,[r,a]=$.useState(""),[o,c]=$.useState("");if(!s?.on)return null;const u=(p,f,m)=>e.mutate({path:"/api/v1/settings",method:"PUT",body:{guard:{allowRead:s.allowRead,allowWrite:s.allowWrite,...p}},done:f},{onSuccess:m}),d=(p,f,m,y)=>{const x=p==="read"?"allowRead":"allowWrite",k=()=>m.trim()&&u({[x]:[...f,m.trim()]},`The project's commands may ${p} ${m.trim()}`,()=>y("")),v=b=>u({[x]:f.filter(N=>N!==b)},`No longer allowed to ${p} ${b}`,()=>{});return t.jsxs("div",{className:"maprow",children:[t.jsx("b",{style:{paddingTop:4},children:p==="read"?"Also read":"Also write"}),t.jsxs("span",{style:{display:"flex",flexDirection:"column",gap:8,minWidth:0},children:[t.jsxs("span",{className:"note",children:[p==="read"?"Files or folders the project needs to read":"Folders the project needs to write in"," outside its copy, such as"," ",t.jsx("span",{className:"mono",children:"~/shared"}),". Add one only when a check stopped because squad-kit blocked a file the project truly needs."]}),f.length>0&&t.jsx("span",{className:"pills",children:f.map(b=>t.jsxs("span",{className:"pill mono",children:[b,t.jsx("button",{className:"linkbtn","aria-label":`Stop allowing ${b}`,title:`Stop allowing ${b}`,disabled:e.isPending,onClick:()=>v(b),children:t.jsx(Xe,{size:12})})]},b))}),t.jsxs("span",{style:{display:"flex",gap:6,alignItems:"center",flexWrap:"wrap"},children:[t.jsx("input",{className:"input mono",style:{fontSize:13,flex:"1 1 200px",minWidth:0},value:m,placeholder:"~/shared","aria-label":`A path to ${p}`,onChange:b=>y(b.target.value),onKeyDown:b=>b.key==="Enter"&&k()}),t.jsx("button",{className:"btn sm",disabled:!m.trim()||e.isPending,onClick:k,children:"Allow"})]}),t.jsx(se,{text:`squad config set allow-${p} ${[...f,m.trim()].filter(Boolean).join(" ")||"~/shared"}`})]})]})};return t.jsxs(t.Fragment,{children:[d("read",s.allowRead,r,a),d("write",s.allowWrite,o,c)]})}function nM(){const e=Qe(),n=e.data?.ready?e.data.tickets.filter(zo):[],s=Su();return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"top",children:[t.jsx("h1",{children:"Waiting for you"}),t.jsx("span",{className:"grow"}),t.jsx(se,{text:"squad inbox"})]}),t.jsx("div",{className:"scroll",children:t.jsx("div",{className:"page",children:n.length+s.length===0?t.jsxs("div",{className:"calm",children:[t.jsx("span",{className:"ring",children:t.jsx(xe,{size:18,strokeWidth:2.5})}),t.jsxs("div",{children:[t.jsx("b",{children:"Nothing needs you right now"}),t.jsx("span",{children:"The squad is working. Questions, plans, proof and decisions land here."})]})]}):t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[s.map(r=>t.jsx(Kj,{w:r},r.id)),n.map(r=>t.jsxs("div",{className:"wcard",style:{padding:"16px 18px 16px 22px"},children:[t.jsxs("div",{className:"grow",children:[t.jsxs("div",{className:"meta",children:[t.jsx("span",{className:"id",children:r.id}),t.jsx(Yj,{t:r}),t.jsx("span",{children:As[r.stage]}),t.jsx("span",{children:nn(r.activity[0]?.at??r.createdAt)})]}),t.jsx("h3",{children:r.title}),t.jsx("p",{children:pm(r)&&r.agentQuestion?`“${r.agentQuestion.text}”`:r.waiting?.summary??(Es(r)?`Change ${Vr(r).id} to the spec waits for you`:ds(r)?Pf(r):r.outdated?.length?Tf(r):`Looks stuck: ${r.quiet?.detail??"no progress"}`)})]}),t.jsx(se,{text:!r.waiting&&Es(r)?`squad propose ${r.id} --approve`:!r.waiting&&ds(r)?`squad test-command ${r.id} --use`:Ef(r)}),r.waiting?.kind==="proof"?t.jsx(Te,{to:"/tickets/$id/proof",params:{id:r.id},className:"btn pri sm",children:Oc(r)}):t.jsx(Te,{to:"/board",search:{ticket:r.id},className:"btn pri sm",children:r.waiting?Oc(r):Es(r)?"Check the change":"Check it"})]},r.id))]})})})]})}function sM(){const e=Qe(),[n,s]=$.useState(!1),r=e.data?.ready?e.data.tickets.filter(a=>a.kind==="bug"):[];return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"top",children:[t.jsx("h1",{children:"Bugs"}),t.jsx("span",{className:"grow"}),t.jsx(se,{text:'squad bug "What happened"'}),t.jsxs("button",{className:"btn pri",onClick:()=>s(!0),children:[t.jsx(Ts,{size:15})," Report a bug"]})]}),t.jsx("div",{className:"scroll",children:t.jsxs("div",{className:"page",children:[t.jsx("p",{className:"note",style:{marginBottom:12},children:"Each bug is a ticket linked to the release it was found in. It goes around the same loop, and the Tester adds a check so it can't come back."}),r.length===0?t.jsx("p",{className:"note",children:"No open bugs."}):t.jsxs("table",{className:"table",children:[t.jsx("thead",{children:t.jsxs("tr",{children:[t.jsx("th",{style:{width:90},children:"ID"}),t.jsx("th",{children:"What happened"}),t.jsx("th",{style:{width:120},children:"Found in"}),t.jsx("th",{style:{width:120},children:"Stage"}),t.jsx("th",{style:{width:240},children:"Now"})]})}),t.jsx("tbody",{children:r.map(a=>t.jsxs("tr",{children:[t.jsx("td",{className:"mono",children:a.id}),t.jsx("td",{children:t.jsx(Te,{to:"/board",search:{ticket:a.id},style:{fontWeight:600},children:a.title})}),t.jsx("td",{children:a.foundIn??""}),t.jsx("td",{children:As[a.stage]}),t.jsx("td",{style:{color:a.waiting?"var(--you-ink)":"var(--muted)"},children:a.waiting?.summary??a.status})]},a.id))})]})]})}),n&&t.jsx(cm,{onClose:()=>s(!1)})]})}const rM={claude:"Claude Code",codex:"Codex"};function iM(){const e=Qe(),n=Ak(),s=e.data?.ready?e.data.meta:void 0,r=Pe({queryKey:["agents"],queryFn:()=>Ee("/api/v1/agents"),refetchInterval:2e3}),[a,o]=$.useState(null);return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"top",children:t.jsx("h1",{children:"Squad and AI"})}),t.jsx("div",{className:"scroll",children:t.jsxs("div",{className:"page",style:{maxWidth:900},children:[t.jsx("h2",{children:"The squad"}),t.jsx("p",{className:"note",style:{marginTop:2},children:"squad-kit is the lead. Each role is its own agent with its own session and tools, and the Reviewer always starts fresh, so every change gets a real second opinion. Strong models where a mistake is expensive, cheaper ones where the work is already clear. Edit an agent to give it house rules or change its models."}),t.jsx(aM,{}),t.jsx(WR,{}),t.jsx("div",{style:{marginTop:10},children:(r.data??[]).map(c=>t.jsxs("div",{className:"maprow",style:{gridTemplateColumns:"34px 120px 1fr 250px 70px",alignItems:"center"},children:[t.jsx(Hr,{role:c.role}),t.jsx("b",{children:c.name}),t.jsxs("span",{style:{fontSize:13},children:[t.jsx("span",{className:"note",children:c.job}),c.working.length>0&&t.jsx("span",{style:{display:"block",marginTop:3},children:c.working.map(u=>t.jsxs(Te,{to:"/board",search:{ticket:u.id},style:{display:"block",color:"var(--accent)"},children:[t.jsx("b",{className:"mono",children:u.id})," ",u.status]},u.id))})]}),t.jsxs("span",{className:"pills",children:[t.jsx("span",{className:"pill",children:rM[c.tool]}),(()=>{const u=c.stepList.find(p=>p.id==="design")??c.stepList[0],d=c.levels?.find(p=>p.step===u?.id)?.now;return d?t.jsxs("span",{className:`pill ${d.from==="squad-kit"?"wait":""}`,title:`${u?.name}: ${Fb(d)}`,children:[d.modelName||d.level,d.effort&&c.supportsEffort?` · ${Za[d.effort]}`:""]}):null})(),Wk(c.instructions).trim()&&t.jsx("span",{className:"pill ok",children:"House rules"})]}),t.jsx("button",{className:"btn sm",onClick:()=>o(c),children:"Edit"})]},c.role))}),t.jsxs("div",{className:"maprow",style:{marginTop:4},children:[t.jsx("b",{children:"Tickets at once"}),t.jsxs("span",{className:"note",children:["Up to ",n.data?.parallel??s?.parallel??2,", shared by all your projects. Change it in Settings."]})]}),t.jsx(LR,{}),t.jsx("h2",{style:{marginTop:30},children:"Your AI tools"}),t.jsx("p",{className:"note",style:{marginTop:2},children:"squad-kit uses the logins you already have. Nothing new to buy."}),(s?.tools??[]).map(c=>t.jsxs("div",{className:"toolrow",children:[t.jsx("span",{className:"logo",children:t.jsx(_c,{size:18})}),t.jsxs("span",{children:[t.jsx("b",{children:c.name}),t.jsx("br",{}),t.jsx("span",{className:"note",children:c.name==="Codex"?"Your ChatGPT subscription":"Your Claude subscription"})]}),t.jsx("span",{className:`pill ${c.ready?"ok":"wait"}`,children:c.ready?"Ready":"Not found"})]},c.name)),t.jsx(Jz,{}),t.jsxs("div",{className:"toolrow off",children:[t.jsx("span",{className:"logo",children:t.jsx(_c,{size:18})}),t.jsxs("span",{children:[t.jsx("b",{children:"Gemini CLI, Copilot CLI, Cursor"}),t.jsx("br",{}),t.jsx("span",{className:"note",children:"Coming next"})]}),t.jsx("span",{})]})]})}),a&&t.jsx(oM,{agent:a,onClose:()=>o(null)})]})}const s2=[{id:"best",name:"Best",note:"The strongest model builds and reviews. Uses your plan's limits faster."},{id:"balanced",name:"Balanced",note:"The strongest model at medium effort."},{id:"thrifty",name:"Thrifty",note:"A lighter model builds. Cheapest."}];function aM(){const e=Qe(),n=pe(),s=e.data?.ready?e.data.meta:void 0;if(!s)return null;const r=s.quality??"best";return t.jsxs("div",{className:"maprow",style:{marginTop:6},children:[t.jsx("b",{style:{paddingTop:4},children:"Quality"}),t.jsxs("span",{style:{display:"flex",flexDirection:"column",gap:6,minWidth:0},children:[t.jsxs("span",{style:{display:"flex",gap:6,alignItems:"center",flexWrap:"wrap"},children:[s2.map(a=>t.jsx("button",{className:`btn sm ${a.id===r?"pri":""}`,"aria-pressed":a.id===r,onClick:()=>n.mutate({path:"/api/v1/settings",method:"PUT",body:{quality:a.id},done:`Quality is ${a.name} now. The squad uses it from its next step.`}),children:a.name},a.id)),t.jsx("span",{className:"grow"}),t.jsx(se,{text:`squad config set quality ${r}`})]}),s2.map(a=>t.jsxs("span",{className:"note",style:{fontSize:12.5,...a.id===r?{color:"var(--text)"}:{}},children:[t.jsxs("b",{children:[a.name,":"]})," ",a.note]},a.id))]})]})}function oM({agent:e,onClose:n}){const s=pe(),r=M=>Wk(M??"").trim(),[a,o]=$.useState(e.tool),[c,u]=$.useState(e.model),[d,p]=$.useState(e.youRole?.model??""),[f,m]=$.useState(()=>Object.fromEntries(e.levels.map(M=>[M.step,M.team??{}]))),[y,x]=$.useState(()=>Object.fromEntries(e.levels.map(M=>[M.step,M.you??{}]))),[k,v,b]=we(`agent-${e.role}`,"instructions",r(e.instructions)),[N,C]=$.useState(()=>Object.fromEntries(e.stepList.map(M=>[M.id,r(e.steps?.[M.id])]))),S=Pe({queryKey:["core-prompts",e.role],queryFn:()=>Ee(`/api/v1/agents/${e.role}/prompts`)}),P=async()=>{const M=(F,R)=>(F?.level??"")===(R.level??"")&&(F?.effort??"")===(R.effort??"");try{for(const F of e.levels)M(F.you,y[F.step])||await bt("/api/v1/me/levels","PUT",{key:`${e.role}.${F.step}`,...y[F.step]});(e.youRole?.model??"")!==d.trim()&&await bt("/api/v1/me/levels","PUT",{key:e.role,...e.youRole,model:d.trim()})}catch(F){return s.reset(),alert(F instanceof Error?F.message:String(F))}const T={};(e.teamRole?.level||e.teamRole?.effort)&&(T[e.role]={level:e.teamRole.level,effort:e.teamRole.effort});for(const[F,R]of Object.entries(f))(R.level||R.effort)&&(T[`${e.role}.${F}`]=R);s.mutate({path:`/api/v1/agents/${e.role}`,method:"PUT",body:{tool:a,model:c,instructions:k,steps:N,levels:T},done:`${e.name} saved. It uses this from its next step.`},{onSuccess:()=>{b(),n()}})};return t.jsxs(Ve,{title:`Edit the ${e.name}`,wide:!0,onClose:n,footer:t.jsxs(t.Fragment,{children:[t.jsx("button",{className:"btn pri",disabled:s.isPending,onClick:P,children:"Save"}),t.jsx("button",{className:"btn",onClick:n,children:"Cancel"}),t.jsx("span",{className:"grow"}),t.jsx("span",{className:"note mono",style:{fontSize:12},children:e.file})]}),children:[t.jsxs("p",{className:"note",style:{marginTop:0},children:[e.job,"."]}),t.jsxs("div",{className:"maprow",style:{alignItems:"center"},children:[t.jsx("b",{children:"AI tool"}),t.jsxs("select",{className:"input",value:a,onChange:M=>o(M.target.value),children:[t.jsx("option",{value:"claude",children:"Claude Code"}),t.jsx("option",{value:"codex",disabled:!0,children:"Codex (coming soon)"})]})]}),t.jsx(cM,{agent:e,team:f,setTeam:m,you:y,setYou:x}),t.jsxs("details",{style:{marginTop:8},children:[t.jsx("summary",{className:"note",children:"Pin exact models (advanced)"}),t.jsxs("div",{className:"maprow",style:{alignItems:"center"},children:[t.jsx("b",{children:"For the team"}),t.jsx("input",{className:"input mono",style:{fontSize:13},value:c,placeholder:"Empty: use the levels above",onChange:M=>u(M.target.value)})]}),t.jsxs("div",{className:"maprow",style:{alignItems:"center"},children:[t.jsx("b",{children:"Just for me"}),t.jsx("input",{className:"input mono",style:{fontSize:13},value:d,placeholder:"Empty: use the levels above",onChange:M=>p(M.target.value)})]}),t.jsx("p",{className:"note",style:{fontSize:12.5},children:"A pinned model wins over every level. Levels are better for the team: they work whatever AI tool each person uses."})]}),t.jsxs("div",{style:{marginTop:12},children:[t.jsx("b",{style:{display:"block",marginBottom:6},children:"House rules for every step"}),t.jsx("textarea",{className:"input",rows:4,style:{width:"100%",resize:"vertical"},value:k,placeholder:`Extra instructions the ${e.name} reads in every step, in plain words.`,onChange:M=>v(M.target.value)})]}),t.jsxs("p",{className:"note",style:{fontSize:12.5},children:["Each step has a core prompt that squad-kit keeps and improves with every release. Your instructions are added to it, never instead of it.",S.data&&` The prompts below are filled in from ${S.data.ticket.id} "${S.data.ticket.title}".`]}),e.stepList.map(M=>{const T=S.data?.prompts.find(F=>F.step===M.id);return t.jsxs("div",{className:"agentstep",children:[t.jsx("b",{children:M.name}),t.jsx("textarea",{className:"input",rows:2,style:{width:"100%",resize:"vertical"},value:N[M.id]??"",placeholder:`Only for the ${M.name} step. For example: ${uM[M.id]??"keep it short"}.`,onChange:F=>C({...N,[M.id]:F.target.value})}),t.jsxs("details",{children:[t.jsxs("summary",{children:["Core prompt for ",M.name,", read only"]}),t.jsx("pre",{className:"coreprompt",children:T?T.prompt:S.isLoading?"Loading…":"Not available."})]})]},M.id)})]})}function Fb(e){const n=e.from==="project"?"set by the team":e.from==="you"?"set by you":"squad-kit's default";return`${e.modelName||e.level} (${e.model?"pinned":e.level}${e.effort?`, ${Za[e.effort]} effort`:""}), ${n}${e.why?`, ${e.why}`:""}`}const lM={strongest:"Strongest",balanced:"Balanced",fast:"Fast"},Za={xhigh:"extra high",high:"high",medium:"medium",low:"low"};function r2({value:e,onChange:n,below:s,agent:r}){return t.jsxs("span",{style:{display:"flex",flexDirection:"column",gap:4,minWidth:0},children:[t.jsxs("select",{className:"input",style:{fontSize:12.5,padding:"4px 6px",width:"100%"},value:e.level??"",onChange:a=>n({...e,level:a.target.value||void 0}),"aria-label":"Level",children:[t.jsxs("option",{value:"",children:["Default",s.level?` (${s.level})`:""]}),["strongest","balanced","fast"].map(a=>t.jsxs("option",{value:a,children:[lM[a],r.modelOf[a]?` · ${r.modelOf[a]}`:""]},a))]}),r.supportsEffort&&t.jsxs("select",{className:"input",style:{fontSize:12.5,padding:"4px 6px",width:"100%"},value:e.effort??"",onChange:a=>n({...e,effort:a.target.value||void 0}),"aria-label":"Effort",children:[t.jsxs("option",{value:"",children:["Default",s.effort?` (${Za[s.effort]} effort)`:""]}),r.efforts.map(a=>t.jsxs("option",{value:a,children:[Za[a].charAt(0).toUpperCase(),Za[a].slice(1)," effort"]},a))]})]})}function cM({agent:e,team:n,setTeam:s,you:r,setYou:a}){return t.jsxs("div",{style:{marginTop:12},children:[t.jsx("b",{style:{display:"block",marginBottom:2},children:"Models"}),t.jsx("p",{className:"note",style:{marginTop:0,fontSize:12.5},children:"squad-kit picks a level for each step from the Quality setting: strongest where a mistake is expensive, cheaper where the work is clear. Change it for the whole team, or just for you. After a failed try, the Builder moves up a level on its own."}),t.jsxs("div",{className:"levels",role:"table",children:[t.jsxs("div",{className:"levrow head",role:"row",children:[t.jsx("span",{children:"Step"}),t.jsx("span",{children:"For the team"}),t.jsx("span",{children:"Just for me"}),t.jsx("span",{children:"Now"})]}),e.levels.map(o=>t.jsxs("div",{className:"levrow",role:"row",children:[t.jsx("span",{children:o.name}),t.jsx(r2,{agent:e,value:n[o.step]??{},below:o.standard,onChange:c=>s({...n,[o.step]:c})}),t.jsx(r2,{agent:e,value:r[o.step]??{},below:{...o.standard,...n[o.step]??{}},onChange:c=>a({...r,[o.step]:c})}),t.jsx("span",{className:"note",style:{fontSize:12.5},children:Fb(o.now)})]},o.step))]})]})}const uM={questions:"always ask who will use it",spec:'write "done when" items a clerk can check by hand',scan:"the old /legacy folder is not used",design:"prefer the existing service layer over new packages",build:"use our logger, never console.log",fix:"never turn a failing test off",review:"check every query for missing tenant filters",proof:"take screenshots in Arabic too"},dM=[{key:"setup",label:"Set up",hint:"Installs what the project needs, e.g. npm install"},{key:"test",label:"Test",hint:"Runs the tests, e.g. npm test"},{key:"lint",label:"Lint",hint:"Checks code style, e.g. npm run lint"},{key:"build",label:"Build",hint:"Builds the project, e.g. npm run build"},{key:"start",label:"Start",hint:"Runs the app for screenshots, e.g. npm start"},{key:"url",label:"App address",hint:"Where the app opens, e.g. http://localhost:3000"},{key:"deploy",label:"Pipeline",hint:"Runs after a release, e.g. az pipelines run …"}];function hM(){const e=Qe(),n=e.data?.ready?e.data.meta:void 0;if(!n)return null;const s=n.repos?.length?n.repos:[{path:".",base:n.git?.base??"main",remote:n.git?.remote??"",commands:n.commands??{}}],r=!!n.repos?.length;return t.jsxs(t.Fragment,{children:[t.jsx("h2",{style:{marginTop:6},children:"How the squad checks and runs this project"}),t.jsxs("p",{className:"note",style:{margin:"2px 0 10px"},children:["The Architect filled these in when it read the project. squad-kit runs Test, Lint and Build itself before anything ships.",r&&" This workspace has several code repos; each ticket works in one of them."]}),s.map(a=>t.jsx(pM,{repo:a,multi:r},a.path)),t.jsx(vM,{})]})}function pM({repo:e,multi:n}){const s=pe(),[r,a]=$.useState(null),[o,c]=$.useState(null),u=r??e.commands,d=o??{base:e.base,remote:e.remote},p=()=>{const f=n?{repos:[{path:e.path,...d,commands:u}]}:{commands:u,git:d};s.mutate({path:"/api/v1/settings",method:"PUT",body:f,done:"Settings saved"},{onSuccess:()=>{a(null),c(null)}})};return t.jsxs("div",{style:{marginBottom:24},children:[n&&t.jsxs("h3",{className:"mono",style:{fontSize:14,margin:"18px 0 2px"},children:[e.path,e.summary&&t.jsx("span",{className:"note",style:{fontFamily:"inherit",marginLeft:8},children:e.summary})]}),dM.map(f=>t.jsxs("div",{className:"maprow",style:{alignItems:"center"},children:[t.jsx("b",{children:f.label}),t.jsx("input",{className:"input mono",style:{fontSize:13},value:u[f.key]??"",placeholder:f.hint,onChange:m=>a({...u,[f.key]:m.target.value})})]},f.key)),t.jsxs("div",{className:"maprow",style:{alignItems:"center"},children:[t.jsx("b",{children:"Release branch"}),t.jsx("input",{className:"input mono",style:{fontSize:13},value:d.base,onChange:f=>c({...d,base:f.target.value})})]}),t.jsxs("div",{className:"maprow",style:{alignItems:"center"},children:[t.jsx("b",{children:"Push to"}),t.jsx("input",{className:"input mono",style:{fontSize:13},value:d.remote,placeholder:"origin (empty: no push)",onChange:f=>c({...d,remote:f.target.value})})]}),t.jsx("div",{style:{marginTop:12},children:t.jsxs("button",{className:"btn pri sm",disabled:!r&&!o,onClick:p,children:["Save",n?` ${e.path}`:""]})})]})}function fM(){const e=pe(),n=Pe({queryKey:["tracker"],queryFn:()=>Ee("/api/v1/tracker"),refetchInterval:6e4}),[s,r]=$.useState(null),a=n.data,o=s??{organization:a?.organization??"",project:a?.project??"",token:""},c=a?.type==="azure"&&a.user;return t.jsxs("div",{style:{marginBottom:26},children:[t.jsx("h2",{style:{marginTop:6},children:"Azure DevOps"}),t.jsx("p",{className:"note",style:{margin:"2px 0 10px"},children:"Stories and bugs come from Azure Boards. squad-kit moves them along as the squad works, opens a pull request for each finished ticket, and merges it when you release. Your token stays on this computer."}),a&&t.jsxs("div",{className:"maprow",style:{alignItems:"center"},children:[t.jsx("b",{children:"Status"}),t.jsx("span",{children:c?t.jsxs("span",{className:"pill ok",children:["Connected as ",a.user]}):a.type==="azure"?t.jsx("span",{className:"pill bug",children:a.error??(a.hasToken?"Not connected":"Needs a token")}):t.jsx("span",{className:"pill wait",children:"Not set up"})})]}),t.jsxs("div",{className:"maprow",style:{alignItems:"center"},children:[t.jsx("b",{children:"Organization"}),t.jsx("input",{className:"input mono",style:{fontSize:13},value:o.organization,placeholder:"e.g. momenysr",onChange:u=>r({...o,organization:u.target.value})})]}),t.jsxs("div",{className:"maprow",style:{alignItems:"center"},children:[t.jsx("b",{children:"Project"}),t.jsx("input",{className:"input mono",style:{fontSize:13},value:o.project,placeholder:"e.g. Mawid",onChange:u=>r({...o,project:u.target.value})})]}),t.jsxs("div",{className:"maprow",style:{alignItems:"center"},children:[t.jsx("b",{children:"Token"}),t.jsx("input",{className:"input mono",style:{fontSize:13},type:"password",autoComplete:"off",value:o.token,placeholder:a?.hasToken?"Saved. Paste a new one to replace it":"Personal access token from Azure DevOps",onChange:u=>r({...o,token:u.target.value})})]}),t.jsxs("div",{style:{marginTop:12,display:"flex",gap:10,alignItems:"center"},children:[t.jsx("button",{className:"btn pri sm",disabled:!s||e.isPending,onClick:()=>e.mutate({path:"/api/v1/tracker",method:"PUT",body:o,done:"Azure DevOps is connected"},{onSuccess:()=>{r(null),n.refetch()}}),children:e.isPending?"Checking…":"Save and check"}),t.jsx("span",{className:"note",children:"Token scopes: Work Items and Code (read, write and manage)."}),t.jsx("span",{className:"grow"}),t.jsx(se,{text:"squad config set tracker"})]})]})}function mM(){const e=pe(),n=Pe({queryKey:["speech"],queryFn:()=>Ee("/api/v1/speech")}),[s,r]=$.useState(""),a=n.data?.hasKey,o=(c,u)=>e.mutate({path:"/api/v1/speech",method:"PUT",body:c,done:u},{onSuccess:()=>{r(""),n.refetch()}});return t.jsxs("div",{style:{marginBottom:26},children:[t.jsx("h2",{style:{marginTop:6},children:"Speech to text"}),t.jsx("p",{className:"note",style:{margin:"2px 0 10px"},children:"Agents cannot listen. With a Munsit key, squad-kit writes out every voice and video note you attach, in Arabic or English, and takes pictures of the screen in videos. Without a key, notes stay attached but nobody hears them. Your key stays on this computer."}),t.jsxs("div",{className:"maprow",style:{alignItems:"center"},children:[t.jsx("b",{children:"Status"}),t.jsx("span",{children:a?t.jsx("span",{className:"pill ok",children:"Munsit is set up"}):t.jsx("span",{className:"pill wait",children:"Not set up"})})]}),t.jsxs("div",{className:"maprow",style:{alignItems:"center"},children:[t.jsx("b",{children:"Munsit key"}),t.jsx("input",{className:"input mono",style:{fontSize:13},type:"password",autoComplete:"off",value:s,placeholder:a?"Saved. Paste a new one to replace it":"API key from munsit.com",onChange:c=>r(c.target.value)})]}),t.jsxs("div",{style:{marginTop:12,display:"flex",gap:10,alignItems:"center"},children:[t.jsx("button",{className:"btn pri sm",disabled:!s.trim()||e.isPending,onClick:()=>o({munsit:s},"Munsit is set up"),children:"Save"}),a&&t.jsx("button",{className:"btn sm",disabled:e.isPending,onClick:()=>o({remove:!0},"Munsit key removed"),children:"Remove"})]})]})}function gM(){const{restarting:e,restart:n}=Pk();return t.jsxs("div",{className:"maprow",style:{alignItems:"center"},children:[t.jsx("b",{children:"Board"}),t.jsxs("span",{style:{display:"flex",gap:10,alignItems:"center",flexWrap:"wrap"},children:[t.jsx("button",{className:"btn sm",disabled:e,onClick:()=>void n(),children:e?"Restarting…":"Restart the board"}),t.jsx("span",{className:"note",children:"Same link. Running work picks up where it stopped."}),t.jsx(se,{text:"squad console --restart"})]})]})}function xM(){const e=Qe(),n=pe(),s=e.data?.ready?e.data.meta:void 0;if(!s)return null;const r=s.runner??"acp",a=(o,c)=>n.mutate({path:"/api/v1/settings",method:"PUT",body:{runner:o},done:c});return t.jsxs("div",{className:"maprow",style:{alignItems:"center"},children:[t.jsx("b",{children:"Talk to Claude"}),t.jsxs("span",{style:{display:"flex",gap:6,alignItems:"center",flexWrap:"wrap"},children:[t.jsx("button",{className:`btn sm ${r==="acp"?"pri":""}`,onClick:()=>a("acp","The squad talks to Claude through ACP"),children:"Agent Client Protocol"}),t.jsx("button",{className:`btn sm ${r==="direct"?"pri":""}`,onClick:()=>a("direct","The squad runs Claude Code directly"),children:"Directly"}),t.jsx("span",{className:"note",style:{marginLeft:6},children:"ACP is the open standard for agents. If it cannot start, a step runs Claude Code directly."})]})]})}function yM(){const e=Ak(),n=pe(),s=e.data;return s?t.jsxs("div",{className:"maprow",style:{alignItems:"center"},children:[t.jsx("b",{children:"Tickets at once"}),t.jsxs("span",{style:{display:"flex",gap:6,alignItems:"center",flexWrap:"wrap"},children:[Array.from({length:s.max},(r,a)=>a+1).map(r=>t.jsx("button",{className:`btn sm ${r===s.parallel?"pri":""}`,onClick:()=>n.mutate({path:"/api/v1/app/settings",method:"PUT",body:{parallel:r},done:`Up to ${r} tickets at once, across all your projects`}),children:r},r)),t.jsx("span",{className:"note",style:{marginLeft:6},children:"How many tickets the squads work on at the same time, across all your projects. They share your AI accounts."})]})]}):null}function kM({on:e}){const n=pe();return t.jsxs("div",{className:"maprow",style:{alignItems:"center"},children:[t.jsx("b",{children:"Project documents in git"}),t.jsxs("span",{style:{display:"flex",gap:10,alignItems:"center",flexWrap:"wrap"},children:[t.jsx("button",{className:"btn sm",onClick:()=>n.mutate({path:"/api/v1/settings",method:"PUT",body:{documentsInGit:!e},done:e?"Project documents stay out of git":"Project documents go into git with each ticket"}),children:e?"On: turn it off":"Off: turn it on"}),t.jsx("span",{className:"note",children:"On: each ticket's spec, design and decisions are committed with its code, so they reach the team through the pull request. Hand over needs it on."})]})]})}function vM(){const e=pe();return t.jsx("div",{style:{margin:"4px 0 26px"},children:t.jsx("button",{className:"btn sm",onClick:()=>e.mutate({path:"/api/v1/scan",done:"The Architect is reading the project again"}),children:"Read the project again"})})}function jM(){const e=Qe(),{theme:n,toggleTheme:s,showCommands:r,toggleCommands:a}=qe(),o=pe(),[c,u]=$.useState(!1),d=e.data?.ready?e.data.meta:void 0;return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"top",children:t.jsx("h1",{children:"Settings"})}),t.jsx("div",{className:"scroll",children:t.jsxs("div",{className:"page",style:{maxWidth:760},children:[t.jsxs("div",{className:"maprow",children:[t.jsx("b",{children:"Theme"}),t.jsx("span",{children:t.jsx("button",{className:"btn sm",onClick:s,children:n==="light"?"Switch to dark":"Switch to light"})})]}),t.jsxs("div",{className:"maprow",children:[t.jsx("b",{children:"Terminal commands"}),t.jsxs("span",{style:{display:"flex",gap:10,alignItems:"center"},children:[t.jsx("button",{className:"btn sm",onClick:a,children:r?"Hide them":"Show them"}),t.jsx("span",{className:"note",children:"Every button shows the command that does the same thing."})]})]}),t.jsx(gR,{}),t.jsxs("div",{className:"maprow",children:[t.jsx("b",{children:"Project files"}),t.jsxs("span",{className:"note",children:[t.jsx("span",{className:"mono",style:{fontSize:13},children:".squad/"})," in the project folder: specs, decisions and releases, shared with the team. Live progress, chats and sign-ins stay on this computer."]})]}),d?.engine==="live"&&t.jsx(kM,{on:d.documentsInGit!==!1}),t.jsx(gM,{}),d?.engine==="live"&&t.jsx(yM,{}),d?.engine==="live"&&t.jsx(xM,{}),d?.engine==="live"&&t.jsx(eM,{hosts:d.allowedHosts??[]}),d?.engine==="live"&&t.jsx(fM,{}),d?.engine==="live"&&t.jsx(mM,{}),d?.engine==="live"&&t.jsx(hM,{}),d?.engine==="demo"&&t.jsxs("div",{className:"maprow",children:[t.jsx("b",{children:"Demo board"}),t.jsxs("span",{style:{display:"flex",gap:10,alignItems:"center",flexWrap:"wrap"},children:[t.jsxs("button",{className:"btn sm danger",onClick:()=>u(!0),children:[t.jsx(qr,{size:13})," Start the demo over"]}),t.jsxs("span",{className:"note",children:["The squad plays back a recorded run at ",d.speed,"x speed."]})]})]}),d&&t.jsx(DR,{}),t.jsx("h2",{style:{marginTop:26},children:"About squad-kit"}),t.jsx(Fk,{}),t.jsx(zA,{})]})}),c&&t.jsx(Ve,{title:"Start the demo over?",onClose:()=>u(!1),footer:t.jsxs(t.Fragment,{children:[t.jsxs("button",{className:"btn pri",onClick:()=>o.mutate({path:"/api/v1/demo/reset",done:"The demo board is fresh again."},{onSuccess:()=>u(!1)}),children:[t.jsx(qr,{size:15})," Start over"]}),t.jsx("button",{className:"btn",onClick:()=>u(!1),children:"Cancel"}),t.jsx("span",{className:"grow"}),t.jsx(se,{text:"squad demo"})]}),children:t.jsx("p",{children:"Every ticket, release and decision goes back to how the demo starts."})})]})}const i2=2e3,a2=e=>`/p/${encodeURIComponent(e)}`;function bM(e,n){const s=Hi(n);return e.replace(/\bsquad ([a-z-]+) (\S+)/g,(r,a,o)=>`squad ${a} ${o} --project ${s}`)}function wM(e,n){return n&&e.startsWith(n)?`~${e.slice(n.length)}`:e}function NM(){const{theme:e,toggleTheme:n}=qe(),s=Pe({queryKey:["app","projects"],queryFn:()=>Ee("/api/v1/app/projects"),refetchInterval:i2}),r=Pe({queryKey:["app","waiting"],queryFn:()=>Ee("/api/v1/app/waiting"),refetchInterval:i2}),[a,o]=$.useState(!1),[c,u]=$.useState(null),d=s.data?.projects??[],p=r.data?.items??[],f=Hj(),m=p.length+f.length;return t.jsxs("div",{className:"home",children:[t.jsxs("header",{className:"home-top",children:[t.jsx("img",{src:"/logo.svg",alt:""}),t.jsx("b",{children:"squad-kit"}),t.jsx("span",{className:"grow"}),s.data&&t.jsx(SM,{s:s.data}),t.jsx(w8,{}),t.jsx("button",{className:"theme",onClick:n,"aria-label":e==="light"?"Switch to dark":"Switch to light",children:e==="light"?t.jsx(To,{size:15}):t.jsx(Ao,{size:15})})]}),t.jsx(Mk,{}),t.jsx(rf,{}),t.jsx(sf,{}),t.jsx(cR,{}),t.jsx("div",{className:"scroll",children:t.jsxs("div",{className:"page home-page",children:[t.jsxs("section",{className:"home-projects",children:[t.jsxs("div",{className:"home-h",children:[t.jsx("h2",{children:"Projects"}),t.jsx("span",{className:"grow"}),t.jsx(se,{text:"squad projects"}),t.jsxs("button",{className:"btn pri",onClick:()=>o(!0),children:[t.jsx(Tt,{size:15})," Add project"]})]}),s.isLoading?null:d.length===0?t.jsxs("button",{className:"home-empty",onClick:()=>o(!0),children:[t.jsx(gk,{size:22}),t.jsx("b",{children:"Add your first project"}),t.jsx("span",{children:"Pick its folder: one repo, a folder with several repos, or a new, empty folder for a new project."})]}):t.jsx("div",{className:"pcards",children:d.map(y=>t.jsx(CM,{p:y,onRemove:()=>u(y)},y.id))})]}),t.jsxs("section",{className:"home-inbox",id:"waiting",children:[t.jsxs("div",{className:"home-h",children:[t.jsx("h2",{children:"Waiting for you"}),m>0&&t.jsx("span",{className:"badge you",children:m}),t.jsx("span",{className:"grow"}),t.jsx(se,{text:"squad inbox"})]}),m===0?t.jsxs("div",{className:"calm",children:[t.jsx("span",{className:"ring",children:t.jsx(xe,{size:18,strokeWidth:2.5})}),t.jsxs("div",{children:[t.jsx("b",{children:"Nothing needs you right now"}),t.jsx("span",{children:d.length?"The squads are working. Questions, plans, proof and decisions from every project land here.":"Add a project to start."})]})]}):t.jsxs("div",{className:"home-waiting",children:[f.map(y=>t.jsx(Kj,{w:y},`${y.project?.id??""}/${y.id}`)),p.map(({project:y,ticket:x})=>t.jsxs("div",{className:"wcard",children:[t.jsxs("div",{className:"grow",children:[t.jsxs("div",{className:"meta",children:[t.jsx("span",{className:"pill sm",children:y.name}),t.jsx("span",{className:"id",children:x.id}),t.jsx("span",{children:As[x.stage]}),t.jsx("span",{children:nn(x.activity[0]?.at??x.createdAt)})]}),t.jsx("h3",{children:x.title}),t.jsx("p",{children:x.waiting?.summary??(Es(x)?`Change ${Vr(x).id} to the spec waits for you`:ds(x)?Pf(x):x.outdated?.length?Tf(x):`Looks stuck: ${x.quiet?.detail??""}`)})]}),t.jsx(se,{text:bM(Ef(x),y.name)}),t.jsx("a",{className:"btn pri sm",href:x.waiting?.kind==="proof"?`${a2(y.id)}/tickets/${encodeURIComponent(x.id)}/proof`:`${a2(y.id)}/board?ticket=${encodeURIComponent(x.id)}`,children:x.waiting?Oc(x):"Check it"})]},`${y.id}/${x.id}`))]})]})]})}),a&&t.jsx(TM,{onClose:()=>o(!1)}),c&&t.jsx(PM,{p:c,onClose:()=>u(null)})]})}function SM({s:e}){const n=zn(),{toast:s}=qe(),r=async a=>{try{await bt("/api/v1/app/settings","PUT",{parallel:a}),n.invalidateQueries({queryKey:["app"]}),s(`Up to ${a} tickets at once, across all projects`)}catch(o){s(o instanceof Error?o.message:String(o),"err")}};return t.jsxs("label",{className:"shared",title:"Shared by all your projects, because they use the same AI accounts",children:[t.jsxs("span",{children:["Tickets at once: ",t.jsx("b",{children:e.running})," of"]}),t.jsx("select",{className:"select sm",value:e.parallel,onChange:a=>void r(Number(a.target.value)),"aria-label":"Tickets at once, across all projects",children:Array.from({length:e.max},(a,o)=>o+1).map(a=>t.jsx("option",{value:a,children:a},a))})]})}function CM({p:e,onRemove:n}){const s=zn(),{toast:r}=qe(),[a,o]=$.useState(!1),c=e.setup&&e.setup.status!=="done"?e.setup:null,u=async()=>{o(!0);try{await bt("/api/v1/app/projects","POST",{folder:e.root}),r(`${e.name} is open`)}catch(p){r(p instanceof Error?p.message:String(p),"err")}finally{o(!1),s.invalidateQueries({queryKey:["app"]})}},d=e.open?e.setup?.ready&&!e.setup.approved?t.jsx("span",{className:"you",children:e.setup.line??"Your project overview is ready to check"}):e.setup?.line&&!e.setup.approved?t.jsx("span",{className:e.setup.status==="failed"?"bad":"you",children:e.setup.line}):c?.status==="failed"?t.jsx("span",{className:"bad",children:"The Architect could not read the project"}):c?t.jsxs("span",{className:"you",children:["Setting up: ",c.status==="running"?c.now??"the Architect reads the project":"the Architect reads the project next"]}):t.jsxs("span",{children:[e.tickets," open",e.working>0&&t.jsxs(t.Fragment,{children:[" · ",e.working," working"]}),e.waiting>0&&t.jsxs("span",{className:"you",children:[" · ",e.waiting," waiting for you"]})]}):t.jsxs("span",{className:"bad",children:["Could not open: ",e.why]});return t.jsxs("div",{className:`pcard ${e.open?"":"off"}`,children:[t.jsx("span",{className:"pm",children:e.name.charAt(0).toUpperCase()}),t.jsxs("div",{className:"grow",children:[t.jsxs("b",{children:[e.name,e.engine==="demo"&&t.jsx("small",{className:"demo",children:"Demo"})]}),t.jsx("span",{className:"mono path",title:e.root,children:e.root}),t.jsx("span",{className:"state",children:d})]}),t.jsxs("div",{className:"acts",children:[e.open?t.jsx("a",{className:"btn sm pri",href:e.setup?.line&&!e.setup.approved?e.url.replace(/\/board$/,e.setup.ready?"/overview":"/setup"):e.url,children:e.setup?.line&&!e.setup.approved?e.setup.ready?"Check it":"See the setup":"Open board"}):t.jsx("button",{className:"btn sm",disabled:a,onClick:()=>void u(),children:"Try again"}),t.jsx("button",{className:"btn sm quiet",onClick:n,children:"Remove"})]})]})}const $M=[{kind:"empty",name:"An empty folder",text:"Start from an idea: squad-kit asks what you want to build."},{kind:"older",name:"An older squad-kit",text:"Your specs, plans and decisions stay where they are. squad-kit adds its own files beside them."},{kind:"repos",name:"Several repos",text:"squad-kit reads each one and shows you how they fit together."}];function EM({l:e}){const n=e.look;return n?t.jsxs("div",{className:"ob-found","aria-live":"polite",children:[t.jsxs("div",{className:"ob-found-c",children:[t.jsx("b",{children:n.title}),t.jsx("div",{children:n.found}),t.jsx("div",{children:n.next}),t.jsx("div",{className:"note",children:n.safe})]}),t.jsxs("div",{className:"ob-also",children:[t.jsx("div",{className:"ob-k",children:"squad-kit also handles"}),$M.filter(s=>s.kind!==n.kind).slice(0,2).map(s=>t.jsxs("div",{className:"ob-also-r",children:[t.jsx("b",{children:s.name}),t.jsx("span",{children:s.text})]},s.kind))]}),t.jsx("div",{className:"note",children:n.takes})]}):null}function TM({onClose:e}){const[n,s]=$.useState(""),[r,a]=$.useState(null),[o,c]=$.useState(null),[u,d]=$.useState(!1),p=Pe({queryKey:["app","folders",n],queryFn:()=>Ee(`/api/v1/app/folders${n?`?path=${encodeURIComponent(n)}`:""}`)}),f=p.data,m=N=>N.replace(/[/\\][^/\\]+[/\\]?$/,"")||"/",y=f?.parent??(p.isError&&n?m(n):null),x=N=>{c(null),a(null),s(N)},k=async()=>{if(f){d(!0),c(null);try{const N=await bt("/api/v1/app/projects","POST",{folder:f.path}),C=N.setup&&!N.setup.ready&&!N.setup.approved&&N.setup.line;window.location.assign(C?N.url.replace(/\/board$/,"/setup"):N.url)}catch(N){d(!1),c(N instanceof Error?N.message:String(N))}}},v=async()=>{if(!(!f||!r?.trim()))try{const N=await bt("/api/v1/app/folders","POST",{parent:f.path,name:r.trim()});x(N.path)}catch(N){c(N instanceof Error?N.message:String(N))}},b=f?AM(f.path):[];return t.jsxs(Ve,{title:"Add a project",wide:!0,onClose:e,footer:t.jsxs(t.Fragment,{children:[t.jsx("button",{className:"btn pri",disabled:!f?.canAdd||u||p.isFetching,onClick:()=>void k(),children:u?"Adding…":f?.kind==="project"?"Open it":"Add and get to know it"}),t.jsx("button",{className:"btn",onClick:e,children:"Cancel"}),t.jsx("span",{className:"grow"}),f&&t.jsx(se,{text:`cd ${Le(f.path)} && squad console`})]}),children:[t.jsx("p",{className:"note",children:"Pick the project's folder: one repo, a folder with several repos, or a new, empty folder for a new project."}),f&&t.jsx("div",{className:"places",children:f.places.map(N=>t.jsx("button",{className:`btn sm ${N.path===f.path?"pri":""}`,onClick:()=>x(N.path),children:N.name},N.path))}),t.jsxs("div",{className:"fb",children:[t.jsxs("div",{className:"fb-bar",children:[t.jsx("button",{className:"iconbtn",disabled:!y,onClick:()=>y&&x(y),"aria-label":"Up one folder",title:"Up one folder",children:t.jsx(A6,{size:15})}),t.jsx("span",{className:"crumbs mono",children:b.map((N,C)=>t.jsxs("span",{children:[C>0&&t.jsx(lu,{size:12}),t.jsx("button",{onClick:()=>x(N.path),children:N.name})]},N.path))})]}),t.jsxs("div",{className:"fb-list",role:"list",children:[p.isError&&t.jsx("p",{className:"note bad",children:p.error.message}),f&&f.folders.length===0&&t.jsx("p",{className:"note",children:"No folders inside."}),f?.folders.map(N=>t.jsxs("button",{role:"listitem",className:"fb-row",onClick:()=>x(N.path),children:[N.kind==="project"?t.jsx(R6,{size:16}):N.kind==="repo"?t.jsx(I6,{size:16}):t.jsx(z6,{size:16}),t.jsx("span",{className:"nm",children:N.name}),N.kind==="project"&&t.jsx("span",{className:"pill ok sm",children:"squad-kit project"}),N.kind==="repo"&&t.jsx("span",{className:"pill sm",children:"code repo"})]},N.path))]}),t.jsx("div",{className:"fb-new",children:r===null?t.jsxs("button",{className:"btn sm",disabled:!f,onClick:()=>a(""),children:[t.jsx(gk,{size:14})," New folder here"]}):t.jsxs(t.Fragment,{children:[t.jsx("input",{className:"input",autoFocus:!0,placeholder:"Name of the new folder",value:r,onChange:N=>a(N.target.value),onKeyDown:N=>N.key==="Enter"&&void v()}),t.jsx("button",{className:"btn sm pri",disabled:!r.trim(),onClick:()=>void v(),children:"Make it"}),t.jsx("button",{className:"btn sm",onClick:()=>a(null),children:"Cancel"})]})})]}),f&&t.jsxs("p",{className:"fb-kind",children:[t.jsx("b",{children:wM(f.path,f.home)}),!f.canAdd&&t.jsx("span",{children:"This folder can't be a project. Open a folder inside it, or make a new one here."})]}),f?.canAdd&&t.jsx(EM,{l:f}),o&&t.jsx("p",{className:"fb-error",children:o})]})}function AM(e){const n=e.split("/").filter(Boolean);return[{name:"/",path:"/"},...n.map((s,r)=>({name:s,path:`/${n.slice(0,r+1).join("/")}`}))]}function PM({p:e,onClose:n}){const s=zn(),{toast:r}=qe(),[a,o]=$.useState(!1),c=async()=>{o(!0);try{await bt(`/api/v1/app/projects/${encodeURIComponent(e.id)}`,"DELETE"),s.invalidateQueries({queryKey:["app"]}),r(`${e.name} is out of squad-kit. Its files stay in its folder.`),n()}catch(d){o(!1),r(d instanceof Error?d.message:String(d),"err")}},u=/\s/.test(e.name)?`"${e.name}"`:e.name;return t.jsx(Ve,{title:`Take ${e.name} out of squad-kit?`,onClose:n,footer:t.jsxs(t.Fragment,{children:[t.jsx("button",{className:"btn danger",disabled:a,onClick:()=>void c(),children:"Take it out"}),t.jsx("button",{className:"btn",onClick:n,children:"Cancel"}),t.jsx("span",{className:"grow"}),t.jsx(se,{text:`squad projects --remove ${u}`})]}),children:t.jsxs("p",{children:["Its squad stops. Nothing is deleted: its files stay in ",t.jsx("span",{className:"mono",children:e.root}),". Add it again any time."]})})}function RM(){const e=Di({from:"/conversations"}),n=rn({from:"/conversations"}),s=Vi(Ki),[r,a]=$.useState(""),o=vo(r),u=vo().data??[],d=e.ticket??u.find(x=>x.open)?.id??u[0]?.id,[p,f]=$.useState(null),m=x=>{f(null),n({search:{ticket:x}})},y=x=>{rs.show(x),n({to:"/board"})};return s?t.jsx(OM,{id:d,all:u,pick:m,doc:p,setDoc:f}):t.jsxs("div",{className:"cpage",children:[t.jsx(IM,{q:r,setQ:a}),t.jsxs("div",{className:"cpage-b",children:[t.jsx(MM,{list:o.data??[],id:d,pick:m,searching:!!r.trim()}),t.jsx("section",{className:"ccenter","aria-label":"Conversation",children:d?t.jsx(hm,{id:d,size:"full",onOpenDoc:f,onPanel:()=>y(d)},d):t.jsxs("div",{className:"cempty",children:[t.jsx("p",{children:"No talks yet. Start one with any agent on any ticket."}),t.jsx(nb,{})]})}),p?t.jsx(om,{doc:p,onClose:()=>f(null)}):d?t.jsx(FM,{id:d,onOpenDoc:f}):null]})]})}function IM({q:e,setQ:n}){const s=Qe(),{theme:r,toggleTheme:a}=qe(),o=s.data?.ready?s.data.meta.project:"";return t.jsxs("header",{className:"cpage-h",children:[t.jsxs(Te,{to:"/board",className:"btn",children:[t.jsx(E6,{size:15})," Back to the board"]}),t.jsx("h1",{children:"Conversations"}),t.jsx("span",{className:"cdim",children:o}),t.jsx("span",{className:"grow"}),t.jsxs("label",{className:"search cpage-search",children:[t.jsx(Ui,{size:15}),t.jsx("input",{value:e,onChange:c=>n(c.target.value),placeholder:"Search all conversations","aria-label":"Search all conversations",dir:"auto"})]}),t.jsx("button",{className:"iconbtn",onClick:a,"aria-label":r==="light"?"Switch to dark":"Switch to light",children:r==="light"?t.jsx(To,{size:16}):t.jsx(Ao,{size:16})})]})}function Lb(e){return new Date(e).toDateString()===new Date().toDateString()?Rn(e):Rs(e)}function zM(e){const s=(e.match??e.last?.text??"").replace(/[*_`#>]+/g,"").replace(/\s+/g," ").trim(),r=In(s);return{text:`${e.last?.who==="you"&&!e.match?"You: ":""}${s}`,dir:r.dir,cls:Is(r)}}function MM({list:e,id:n,pick:s,searching:r}){const a=fu(),o=[["Waiting for you",e.filter(c=>c.open&&c.yourTurn)],["Talking now",e.filter(c=>c.open&&!c.yourTurn)],["Earlier",e.filter(c=>!c.open)]];return t.jsx("nav",{className:"clist","aria-label":"All conversations",children:t.jsxs("div",{className:"clist-s",children:[r&&!e.length&&t.jsx("p",{className:"cdim",style:{padding:"14px 18px"},children:"Nothing found."}),o.map(([c,u])=>u.length?t.jsxs("div",{children:[t.jsx("div",{className:"csec",children:c}),u.map(d=>{const p=d.id===n,f=zM(d),m=vm(d,a.seen);return t.jsxs("button",{className:`crow-i ${p?"on":""}`,onClick:()=>s(d.id),"aria-current":p,children:[t.jsx(An,{role:d.with,live:d.thinking}),t.jsxs("span",{className:"rt",children:[t.jsx("span",{className:"cid",children:d.id}),t.jsx("b",{children:at[d.with]}),d.yourTurn&&t.jsx("span",{className:"cwait",children:"Your turn"})]}),t.jsx("span",{className:"rtime",children:d.thinking?"now":Lb(d.at)}),t.jsx("span",{className:`rp ${d.thinking?"t-en":f.cls}`,dir:d.thinking?"ltr":f.dir,children:d.thinking?t.jsxs("span",{className:`rtyping c-${d.with}`,children:[t.jsxs("span",{className:"cdots sm",children:[t.jsx("i",{}),t.jsx("i",{}),t.jsx("i",{})]}),t.jsx("span",{className:"shim",children:"Writing"})]}):f.text||d.title}),m>0&&!p&&t.jsx("span",{className:"cbadge rb",children:m})]},d.id)})]},c):null)]})})}function FM({id:e,onOpenDoc:n}){const s=Ro(e).data,[r,a]=$.useState("spec");if(!s)return t.jsx("aside",{className:"cspec"});const o=[...new Set([...(s.chat?.messages??[]).flatMap(c=>c.files??[]),...s.attachments??[]])];return t.jsxs("aside",{className:"cspec","aria-label":"The ticket's spec",children:[t.jsxs("div",{className:"cstabs",role:"tablist",children:[t.jsx("button",{className:`cstab ${r==="spec"?"on":""}`,role:"tab","aria-selected":r==="spec",onClick:()=>a("spec"),children:s.chat?.open&&!s.chat.beside&&s.chat.with==="analyst"?"Spec draft":"Spec"}),t.jsxs("button",{className:`cstab ${r==="files"?"on":""}`,role:"tab","aria-selected":r==="files",onClick:()=>a("files"),children:["Files · ",o.length]}),t.jsx("button",{className:`cstab ${r==="activity"?"on":""}`,role:"tab","aria-selected":r==="activity",onClick:()=>a("activity"),children:"Activity"})]}),t.jsxs("div",{className:"csbody",children:[r==="spec"&&t.jsx(_M,{t:s}),r==="files"&&(o.length?t.jsx(am,{ticket:s.id,files:o,onOpen:n}):t.jsx("p",{className:"cdim",children:"No files yet. Paste or drop screenshots into the chat."})),r==="activity"&&t.jsx("div",{className:"cact-list",children:s.activity.slice(0,60).map((c,u)=>t.jsxs("div",{className:"cact-row",children:[t.jsx("span",{className:"cdim",children:Lb(c.at)}),t.jsxs("span",{children:[t.jsx("b",{children:$s[c.who]})," ",t.jsx(LM,{text:c.text})]})]},u))})]})]})}function LM({text:e}){const n=In(e);return t.jsx("span",{dir:n.dir,className:Is(n),children:e})}function fc({text:e,fresh:n,chk:s,tone:r}){const a=In(e);return t.jsxs("div",{className:`citem ${n?"new":""} ${r??""}`,children:[s&&t.jsx("span",{className:"cchk"}),t.jsx("span",{className:`grow ${Is(a)}`,dir:a.dir,lang:a.dir==="rtl"?"ar":"en",children:e}),n&&t.jsx("span",{className:"ctag",children:"From chat"})]})}function _M({t:e}){const n=e.chat?.messages[0]?.at??"",s=e.notes??[],r=m=>!!n&&m>=n,a=e.chat?.open&&!e.chat.beside&&e.chat.with==="analyst",o=[...(e.criteria??[]).map(m=>({text:m.then,at:""})),...(e.brief?.criteria??[]).map(m=>({text:m,at:""})),...s.filter(m=>m.kind==="criterion").map(m=>({text:m.text,at:m.at}))],c=[...(e.brief?.rules??[]).map(m=>({text:m,at:""})),...s.filter(m=>m.kind==="rule").map(m=>({text:m.text,at:m.at}))],u=s.filter(m=>m.kind==="note"&&!m.to),d=(e.questions??[]).filter(m=>!m.answer).map(m=>m.text),p=e.story??e.ask,f=In(p);return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"cdim",children:a?"Grows while you talk. Add to it from any message. The spec is written when you press Write the spec.":"What the squad works from. Add to it from any message with Add to spec."}),t.jsx("h3",{children:"Story"}),t.jsx("div",{className:Is(f),dir:f.dir,children:p}),t.jsx("h3",{children:"Done when"}),o.length?o.map((m,y)=>t.jsx(fc,{text:m.text,chk:!0,fresh:r(m.at)},y)):t.jsx("p",{className:"cdim",children:"Nothing yet."}),c.length>0&&t.jsxs(t.Fragment,{children:[t.jsx("h3",{children:"Rules"}),c.map((m,y)=>t.jsx(fc,{text:m.text,fresh:r(m.at)},y))]}),u.length>0&&t.jsxs(t.Fragment,{children:[t.jsx("h3",{children:"Notes"}),u.map((m,y)=>t.jsx(fc,{text:m.text,fresh:r(m.at)},y))]}),d.length>0&&t.jsxs(t.Fragment,{children:[t.jsx("h3",{children:"Still open"}),d.map((m,y)=>t.jsx(fc,{text:m,tone:"open"},y))]})]})}function OM({id:e,all:n,pick:s,doc:r,setDoc:a}){const o=Ro(e).data,c=fu(),u=rn(),{theme:d,toggleTheme:p}=qe(),f=o?.chat,m=o?$j(o):null,y=n.filter(k=>k.open||k.id===e),x=$.useRef(null);return $.useEffect(()=>{x.current?.querySelector(".cv.on")?.scrollIntoView({block:"nearest",inline:"nearest"})},[e,y.length]),t.jsxs("div",{className:"cphone",children:[t.jsxs("header",{className:"cph-h",children:[t.jsx("button",{className:"ib",onClick:()=>r?a(null):void u({to:"/board"}),"aria-label":r?"Close the document":"Back to the board",children:t.jsx(lk,{size:22})}),f&&t.jsx(An,{role:f.with,live:f.thinking}),t.jsxs("div",{className:"cph-who",children:[t.jsxs("div",{children:[t.jsx("b",{children:f?at[f.with]:"Conversations"})," ",o&&t.jsx("span",{className:"cid",children:o.id})]}),m&&t.jsx("div",{className:`cph-stage ${m.tone}`,children:m.text})]}),t.jsx("span",{className:"grow"}),t.jsx("button",{className:"ib",onClick:p,"aria-label":d==="light"?"Switch to dark":"Switch to light",children:d==="light"?t.jsx(To,{size:18}):t.jsx(Ao,{size:18})})]}),y.length>1&&t.jsx("div",{className:"cph-convs",role:"tablist","aria-label":"Conversations",ref:x,children:y.map(k=>{const v=k.id===e,b=vm(k,c.seen);return t.jsxs("button",{className:`cv ${v?"on":""}`,role:"tab","aria-selected":v,"aria-label":`${at[k.with]} on ${k.id}`,onClick:()=>s(k.id),children:[t.jsx(An,{role:k.with,small:!0}),k.id,k.thinking&&!v&&t.jsxs("span",{className:`cdots sm c-${k.with}`,children:[t.jsx("i",{}),t.jsx("i",{}),t.jsx("i",{})]}),b>0&&!v&&t.jsx("span",{className:"cbadge",children:b})]},k.id)})}),e?t.jsx(hm,{id:e,size:"phone",onOpenDoc:a},e):t.jsx("div",{className:"cempty",children:"No talks yet."}),r&&t.jsx("div",{className:"cph-doc",children:t.jsx(om,{doc:r,onClose:()=>a(null)})})]})}function qM(){return Pe({queryKey:["overview"],queryFn:()=>Ee("/api/v1/overview"),refetchInterval:e=>e.state.data?.talk?.thinking||e.state.data?.handover==="reading"?1e3:3e3})}function DM(e){return e?new Date(e).toDateString()===new Date().toDateString()?`Read today at ${Rn(e)}`:`Read on ${Rs(e)}`:""}function BM(){const e=qM(),n=pe(),s=rn(),[r,a]=$.useState(!1),[o,c]=$.useState(!1),u=e.data;if(e.isLoading)return t.jsx("div",{className:"center",children:"Loading the overview…"});if(!u)return t.jsx("div",{className:"center",children:"No overview yet."});const d=f=>void s({to:"/board",search:{ticket:f.id}}),p=u.empty&&u.handover==="ready"&&(!u.idea||o);return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"top",children:[t.jsx("h1",{children:u.project}),u.readAt&&!u.empty&&t.jsx("span",{className:"note ob-read",children:DM(u.readAt)}),t.jsx("span",{className:"grow"}),u.handover!=="reading"&&!u.empty&&t.jsxs("button",{className:"btn",disabled:n.isPending,onClick:()=>n.mutate({path:"/api/v1/overview/read-again",done:"The Architect reads the project again"}),children:[t.jsx(Mi,{size:14})," Read it again"]}),t.jsx(se,{text:u.command})]}),t.jsx("div",{className:"scroll",children:t.jsxs("div",{className:"page ob-page",children:[u.handover==="reading"&&t.jsx(ub,{}),p&&t.jsx(WM,{v:u,onSent:()=>c(!1),onWrite:()=>a(!0)}),u.handover==="ready"&&!p&&!u.talk?.open&&t.jsx(UM,{v:u,...u.empty?{onChange:()=>c(!0)}:{}}),u.talk?.open&&t.jsx(HM,{t:u.talk}),u.handover==="approved"&&u.approved&&t.jsxs("div",{className:"calmlane ob-approved",children:[t.jsx("span",{className:"glyph",children:t.jsx(xe,{size:14,strokeWidth:2.5})}),t.jsxs("span",{children:[t.jsxs("b",{children:[u.approved.by," approved this on ",Rs(u.approved.at),"."]})," ",u.rules.length?"The squad follows these rules. ":"","This page stays up to date after every merged ticket."]})]}),u.old&&t.jsxs("div",{className:"ob-card",children:[t.jsxs("span",{className:"grow",children:[t.jsx("b",{children:"Read by an older squad-kit"}),t.jsx("span",{children:"Read it again to see who uses it, what it can do today, how its parts fit together and three ticket ideas."})]}),t.jsx("button",{className:"btn sm",onClick:()=>n.mutate({path:"/api/v1/overview/read-again",done:"The Architect reads the project again"}),children:"Read it again"})]}),u.empty?!p&&u.handover!=="reading"&&t.jsxs("div",{className:"ob-row2",children:[t.jsx(o2,{v:u}),t.jsx(l2,{v:u,onCreated:d,onWrite:()=>a(!0)})]}):t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"ob-row2",children:[t.jsx(o2,{v:u}),t.jsx(VM,{v:u})]}),u.parts.length>0?t.jsx(KM,{v:u}):u.map.length>0?t.jsx(YM,{v:u}):null,t.jsxs("div",{className:"ob-row3",children:[t.jsx(QM,{v:u}),t.jsx(GM,{v:u}),t.jsx(l2,{v:u,onCreated:d,onWrite:()=>a(!0)})]}),t.jsxs("p",{className:"note ob-foot",children:["Kept in .squad/knowledge, updated after every merged ticket. Decisions and their history are on the ",t.jsx(Te,{to:"/architecture",children:"Architecture page"}),"."]})]})]})}),r&&t.jsx(Nj,{onClose:()=>a(!1),onCreated:d})]})}function WM({v:e,onSent:n,onWrite:s}){const r=pe(),[a,o]=$.useState(e.idea??""),c=()=>{!a.trim()||r.isPending||r.mutate({path:"/api/v1/overview/idea",body:{text:a},done:"The Architect is reading what you want to build"},{onSuccess:n})};return t.jsxs("section",{className:"ob-talk ob-ask","aria-label":"What do you want to build?",children:[t.jsxs("div",{className:"ob-talk-h",children:[t.jsx(An,{role:"architect",small:!0}),t.jsx("h2",{children:"What do you want to build?"})]}),t.jsx("p",{className:"note",children:"Say it in your own words, in Arabic or English. The Architect picks the technology itself when your first story is planned."}),t.jsxs("div",{className:"cbox ob-talk-box",children:[t.jsx("textarea",{className:"cta t-mx",rows:3,dir:"auto",value:a,placeholder:"For example: a page where staff write down visitors' names and see today's list","aria-label":"What you want to build",onChange:u=>o(u.target.value),onKeyDown:u=>{u.key==="Enter"&&!u.shiftKey&&!u.nativeEvent.isComposing&&(u.preventDefault(),c())}}),t.jsxs("div",{className:"crow",children:[t.jsx("span",{className:"grow"}),t.jsx("button",{className:"csend","aria-label":"Send",disabled:!a.trim()||r.isPending,onClick:c,children:t.jsx(os,{size:17})})]})]}),t.jsxs("div",{className:"ob-talk-f",children:[t.jsx("button",{className:"ob-link",onClick:s,children:"Or write your first ticket yourself."}),t.jsx("span",{className:"grow"}),t.jsx(se,{text:'squad overview --build "…"'})]})]})}function UM({v:e,onChange:n}){const s=pe(),r=e.proposed;return t.jsxs("section",{className:"ob-hand","aria-label":"Check the overview",children:[t.jsxs("div",{className:"grow",children:[t.jsx("b",{children:e.empty?"The Architect wrote down what you want to build. Check it, then start.":e.approved&&r?`squad-kit found ${r} new ${r===1?"rule":"rules"} in your code. Check them, then carry on.`:"squad-kit has read your project. Check what it understood, then start."}),t.jsx("span",{children:r?`When you approve, the ${r} ${r===1?"rule":"rules"} below become the rules every agent follows.`:"When you approve, this page becomes the project’s home."})]}),t.jsxs("span",{className:"ob-hand-acts",children:[n?t.jsxs("button",{className:"btn",disabled:s.isPending,onClick:n,children:[t.jsx(Pn,{size:14})," Change what I said"]}):t.jsxs("button",{className:"btn",disabled:s.isPending,onClick:()=>s.mutate({path:"/api/v1/overview/talk",body:{}}),children:[t.jsx(Pn,{size:14})," Something is wrong"]}),t.jsxs("button",{className:"btn pri",disabled:s.isPending,onClick:()=>s.mutate({path:"/api/v1/overview/approve",done:e.empty?"Approved. Start with your first story.":"Approved. The squad follows these rules now. Start with a ticket."}),children:[t.jsx(xe,{size:15})," Looks right, start working"]}),t.jsx(se,{text:"squad overview --approve"})]})]})}function HM({t:e}){const n=pe(),[s,r]=we("overview","talk",""),a=e.messages.some(c=>c.who==="you"),o=(c=s)=>{!c.trim()||e.thinking||n.mutate({path:"/api/v1/overview/talk",body:{text:c}},{onSuccess:()=>r("")})};return t.jsxs("section",{className:"ob-talk","aria-label":"Talk with the Architect",children:[t.jsxs("div",{className:"ob-talk-h",children:[t.jsx(An,{role:"architect",small:!0}),t.jsx("b",{children:"Tell the Architect what is wrong"}),t.jsx("span",{className:"grow"}),t.jsx("button",{className:"iconbtn","aria-label":"Close the talk",onClick:()=>n.mutate({path:"/api/v1/overview/talk/close"}),children:t.jsx(Xe,{size:15})})]}),t.jsxs("div",{className:"ob-thread ccol",children:[e.messages.map((c,u)=>c.who==="you"?t.jsxs("div",{className:"cyou cmsg",children:[t.jsx("div",{className:"cybub",children:t.jsx(mo,{text:c.text,ticket:""})}),t.jsxs("span",{className:"cmeta",children:["You · ",Rn(c.at)]})]},u):c.who==="squad"?t.jsx("div",{className:"cnote-w cmsg",children:t.jsx("span",{className:"cnote-pill",children:c.text})},u):t.jsxs("div",{className:"cag cmsg ag-architect",children:[t.jsx(An,{role:"architect"}),t.jsxs("div",{className:"cwho",children:[t.jsx("b",{children:"Architect"}),t.jsx("span",{className:"ctime",children:Rn(c.at)})]}),t.jsxs("div",{className:"cagb",children:[t.jsx(mo,{text:c.text,ticket:""}),c.options&&c.options.length>0&&u===e.messages.length-1&&t.jsx("div",{className:"cchoices",children:c.options.map(d=>t.jsx("button",{className:"cch",onClick:()=>o(d),children:d},d))})]})]},u)),e.thinking&&t.jsxs("div",{className:"cag cmsg ag-architect thinking",children:[t.jsx(An,{role:"architect",live:!0}),t.jsxs("div",{className:"cwho",children:[t.jsx("b",{children:"Architect"}),t.jsx("span",{className:"shim",children:a?"Reading your message":"Looking at what it wrote"})]}),t.jsx("div",{className:"cagb",children:t.jsxs("span",{className:"cdots","aria-label":"The Architect is answering",children:[t.jsx("i",{}),t.jsx("i",{}),t.jsx("i",{})]})})]})]}),t.jsxs("div",{className:"cbox ob-talk-box",children:[t.jsx("textarea",{className:"cta t-en",rows:2,dir:"auto",value:s,placeholder:"What did squad-kit get wrong? In Arabic or English","aria-label":"Your message",onChange:c=>r(c.target.value),onKeyDown:c=>{c.key==="Enter"&&!c.shiftKey&&!c.nativeEvent.isComposing&&(c.preventDefault(),o())}}),t.jsxs("div",{className:"crow",children:[t.jsx("span",{className:"grow"}),e.thinking?t.jsxs("button",{className:"cstop",onClick:()=>n.mutate({path:"/api/v1/overview/talk/stop"}),children:[t.jsx(us,{size:12,fill:"currentColor"})," Stop"]}):t.jsx("button",{className:"csend","aria-label":"Send",disabled:!s.trim()||n.isPending,onClick:()=>o(),children:t.jsx(os,{size:17})})]})]}),t.jsxs("div",{className:"ob-talk-f",children:[t.jsxs("button",{className:"btn pri",disabled:!a||e.thinking||n.isPending,onClick:()=>n.mutate({path:"/api/v1/overview/talk/read-again",done:"The Architect reads the project again with what you said"}),children:[t.jsx(Mi,{size:14})," Read it again with this"]}),t.jsx("span",{className:"note",children:"The Architect reads the whole project again with what you said. You check the overview again after."}),t.jsx("span",{className:"grow"}),t.jsx(se,{text:'squad overview --wrong "…"'})]})]})}function o2({v:e}){const n=[...e.can.map(s=>({text:s,id:""})),...e.since.map(s=>({text:s.title,id:s.id}))];return t.jsxs("section",{className:"ob-c",children:[t.jsx("h3",{children:"What it is"}),e.summary?t.jsx("p",{className:"ob-lead",dir:"auto",children:e.summary}):t.jsx("p",{className:"note",children:"squad-kit has not read the project yet."}),e.empty&&t.jsx("p",{children:"No code yet. The Architect picks the technology when your first story is planned, and saves it as a decision engineers can see."}),(e.users||n.length>0)&&t.jsxs("div",{className:"ob-two",children:[e.users&&t.jsxs("div",{children:[t.jsx("div",{className:"ob-k",children:"Who uses it"}),t.jsx("p",{children:e.users})]}),n.length>0&&t.jsxs("div",{children:[t.jsx("div",{className:"ob-k",children:"What it can do today"}),t.jsx("ul",{className:"ob-list",children:n.map((s,r)=>t.jsxs("li",{children:[s.text,s.id&&t.jsxs(Te,{to:"/board",search:{ticket:s.id},className:"pill ok sm ob-new",title:"Merged since the first read",children:["new · ",s.id]})]},r))})]})]})]})}function VM({v:e}){const n=e.proof,[s,r]=$.useState(null);return t.jsxs("section",{className:"ob-c",children:[t.jsx("h3",{children:"Proof squad-kit can work here"}),n?t.jsxs("ul",{className:"ob-proof",children:[n.files!==void 0&&t.jsxs("li",{className:"ok",children:[t.jsx(xe,{size:14})," ",n.files?`Read the project: ${n.files} ${n.files===1?"file":"files"}`:"Read the project"]}),(n.tests??[]).map((a,o)=>t.jsxs("li",{className:a.ok?"ok":"bad",children:[a.ok?t.jsx(xe,{size:14}):t.jsx(zr,{size:14}),t.jsxs("span",{children:[a.ok?`Ran your tests${a.repo&&a.repo!=="."?` in ${a.repo}`:""}: ${a.passed!==void 0?`${a.passed} pass`:"they pass"}`:"Your tests did not pass here",!a.ok&&a.output&&t.jsx("button",{className:"btn sm quiet",onClick:()=>r(s===o?null:o),children:s===o?"Hide":"See what failed"})]}),s===o&&a.output&&t.jsx("pre",{className:"ob-out",children:`${a.command}:
636
- ${a.output}`})]},o)),n.tests?.length===0&&t.jsxs("li",{className:"skip",children:[t.jsx(zr,{size:14})," No tests yet. Your first ticket can add some."]}),n.app&&t.jsxs("li",{className:n.app.ok?"ok":"bad",children:[n.app.ok?t.jsx(xe,{size:14}):t.jsx(zr,{size:14}),t.jsx("span",{children:n.app.ok?"Opened the app":"The app did not open here"})]}),n.app?.shot&&t.jsx("li",{className:"ob-shot",children:t.jsx("img",{src:`${Cs(`/api/v1/proof/${n.app.shot}`)}&v=${encodeURIComponent(e.readAt??"")}`,alt:"The app's first page, as squad-kit opened it"})}),n.branch&&t.jsxs("li",{className:"ok",children:[t.jsx(xe,{size:14})," On git branch ",n.branch,", ",n.unsaved?`${n.unsaved} changes not saved in git yet`:"nothing unsaved"]})]}):t.jsx("p",{className:"note",children:e.handover==="reading"?"Comes when the setup has tried your tests and your app.":"Read it again to have squad-kit run your tests and open your app once."})]})}function KM({v:e}){const[n,s]=$.useState(null),{columns:r,below:a}=_8(e.parts,e.links),o=c=>{const u=O8(c,e.parts,e.links);return t.jsxs("button",{className:`ob-node k-${c.kind??"part"} ${n===c.id?"on":""}`,onClick:()=>s(n===c.id?null:c.id),"aria-expanded":n===c.id,children:[t.jsx("b",{children:c.name}),c.what&&t.jsx("span",{children:c.what}),c.files.length>0&&t.jsx("code",{children:n===c.id?c.files.join(`
637
- `):c.files[0]}),n===c.id&&u&&t.jsx("small",{children:u})]},c.id)};return t.jsxs("section",{className:"ob-c",children:[t.jsxs("div",{className:"ob-c-h",children:[t.jsx("h3",{children:"How it fits together"}),t.jsx("span",{className:"note",children:"Click a box to see its files"})]}),t.jsx("div",{className:"ob-flow",children:r.map((c,u)=>t.jsxs("div",{className:"ob-col-w",children:[u>0&&t.jsxs("span",{className:"ob-arw","aria-hidden":!0,children:[t.jsx(lo,{size:16,className:"h"}),t.jsx($6,{size:16,className:"v"})]}),t.jsx("div",{className:"ob-col",children:c.map(o)})]},u))}),a.length>0&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"ob-checks","aria-hidden":!0,children:"↑ checks ↑"}),t.jsx("div",{className:"ob-below",children:a.map(o)})]})]})}function YM({v:e}){return t.jsxs("section",{className:"ob-c",children:[t.jsx("h3",{children:"The project map"}),e.map.map(n=>t.jsxs("div",{className:"maprow",children:[t.jsx("b",{children:n.area}),t.jsx("span",{children:n.detail})]},n.area))]})}function QM({v:e}){const n=e.rules,s=n.filter(r=>r.fromScan).length;return t.jsxs("section",{className:"ob-c",children:[t.jsxs("h3",{children:["Rules the squad ",e.proposed?"will follow":"follows"]}),t.jsx("div",{className:"note",children:n.length?s===n.length?`${s}, taken from your code`:`${n.length}: ${s} from your code, ${n.length-s} from tickets`:"None yet. The Architect proposes them with your first ticket."}),t.jsx("ul",{className:"ob-list",children:n.slice(0,10).map(r=>t.jsxs("li",{title:r.why,children:[r.title,r.proposed&&e.handover!=="ready"&&t.jsx("span",{className:"pill you sm ob-new",children:"proposed"})]},r.id))}),n.length>0&&t.jsx(Te,{to:"/architecture",search:{view:"list"},className:"ob-more",children:"Review them one by one"})]})}function GM({v:e}){return t.jsxs("section",{className:"ob-c",children:[t.jsx("h3",{children:"Worth knowing"}),e.worth.length?t.jsx("ul",{className:"ob-list ob-worth",children:e.worth.map((n,s)=>t.jsx("li",{children:n},s))}):t.jsx("p",{className:"note",children:"Nothing yet."})]})}function l2({v:e,onCreated:n,onWrite:s}){const r=pe();return t.jsxs("section",{className:"ob-c",children:[t.jsx("h3",{children:e.empty?"Your first stories":"Good first tickets"}),t.jsx("ul",{className:"ob-ideas",children:e.ideas.map((a,o)=>t.jsxs("li",{children:[t.jsxs("span",{dir:"auto",children:[t.jsx("b",{children:a.title}),a.why&&t.jsx("small",{children:a.why})]}),a.ticket?t.jsx(Te,{to:"/board",search:{ticket:a.ticket},className:"btn sm",children:a.ticket}):t.jsx("button",{className:"btn sm",disabled:r.isPending,title:`squad overview --idea ${o+1}`,onClick:()=>r.mutate({path:`/api/v1/overview/ideas/${o+1}`,done:"On the board. The Analyst reads it first."},{onSuccess:c=>n(c)}),children:"Create"})]},o))}),t.jsxs("p",{className:"note",children:[e.ideas.length?e.empty?"Ideas from what you said. Or ":"Ideas from what the Architect saw. Or ":"",t.jsx("button",{className:"ob-link",onClick:s,children:e.ideas.length?"write your own.":"Write your first ticket."})]}),e.ideas.some(a=>!a.ticket)&&t.jsx(se,{text:`squad overview --idea ${e.ideas.findIndex(a=>!a.ticket)+1}`}),!e.ideas.length&&t.jsxs("button",{className:"btn sm pri",onClick:s,children:[t.jsx(Tt,{size:14})," New ticket"]})]})}function ZM(){const e=$u(),n=pe(),{theme:s,toggleTheme:r}=qe(),a=e.data?.setup,o=a?a.steps.some(c=>c.state==="now"||c.state==="todo")&&!a.steps.some(c=>c.state==="stopped"||c.id==="read"&&c.state==="failed"):!1;return t.jsxs("div",{className:"ob-setup",children:[t.jsxs("header",{className:"cpage-h",children:[t.jsxs(Te,{to:"/board",className:"btn",children:[t.jsx(yk,{size:15})," See the board meanwhile"]}),t.jsx("span",{className:"grow"}),t.jsx(se,{text:"squad setup"}),t.jsx("button",{className:"iconbtn",onClick:r,"aria-label":s==="light"?"Switch to dark":"Switch to light",children:s==="light"?t.jsx(To,{size:16}):t.jsx(Ao,{size:16})})]}),t.jsx("div",{className:"scroll",children:t.jsx("div",{className:"ob-setup-b",children:e.isLoading?null:a?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"ob-head",children:[t.jsx("div",{className:"ob-proj",children:a.project}),t.jsx("h2",{children:a.approved?"Your project is set up":a.ready?a.empty?"Your new project is ready":"squad-kit knows your project now":"Getting to know your project"}),t.jsx("p",{children:a.ready||a.approved?a.empty?"Tell the Architect what you want to build, on the Overview.":"Check what it understood on the Overview, then start your first ticket.":a.kind==="empty"?"A few seconds for a new project. You can leave this page: we will tell you when it is ready.":"About 3 to 5 minutes. You can leave this page: we will tell you when it is ready."})]}),t.jsx(aI,{s:a}),a.ready&&!a.approved&&t.jsxs("div",{className:"ob-card ready",children:[t.jsx("span",{className:"ob-ring",children:t.jsx(xe,{size:16,strokeWidth:2.5})}),t.jsxs("span",{className:"grow",children:[t.jsx("b",{children:a.empty?"One question for you":"Your project overview is ready"}),t.jsx("span",{children:a.empty?"What do you want to build?":"What squad-kit understood, for you to check before the first ticket."})]}),t.jsxs(Te,{to:"/overview",className:"btn pri",children:[a.empty?"Answer it":"Check what squad-kit understood"," ",t.jsx(lo,{size:15})]})]}),t.jsxs("div",{className:"ob-acts",children:[t.jsx(iI,{s:a}),o&&t.jsx("button",{className:"btn",disabled:n.isPending||a.stopping,onClick:()=>n.mutate({path:"/api/v1/setup/stop",done:"Stopped. Start it again any time."}),children:a.stopping?"Stopping…":"Stop"}),o&&t.jsx(se,{text:"squad setup --stop"}),t.jsx("span",{className:"grow"}),t.jsx(oI,{s:a})]}),!a.approved&&t.jsx(rI,{s:a})]}):t.jsxs("div",{className:"ob-head",children:[t.jsx("h2",{children:"This project is set up"}),t.jsxs("p",{children:["See what squad-kit understood on the ",t.jsx(Te,{to:"/overview",children:"Overview"}),"."]})]})})})]})}const or=e=>`/api/v1/requirements/${encodeURIComponent(e)}`;function XM(e,n){const[s,r]=$.useState(Date.now());return $.useEffect(()=>{if(!n)return;const a=setInterval(()=>r(Date.now()),e);return()=>clearInterval(a)},[e,n]),s}function JM({s:e}){return t.jsx("span",{className:`rq-dot ${e.state}`,"aria-hidden":"true",children:e.state==="done"?t.jsx(xe,{size:12,strokeWidth:3.2}):e.state==="now"?t.jsx("i",{}):null})}const eF={done:"Done",now:"Now",todo:"Still to come",failed:"Stopped here"};function tF({v:e}){const n=wt(),s=e.state.job,r=Kr(s),a=XM(5e3,r),o=t7(e),c=s?.status==="stopping",u=e.status==="drafting"?"The Analyst is writing the breakdown":"The Analyst is reading your BRD";return t.jsxs("section",{className:"rq-card rq-reading","aria-label":u,children:[t.jsxs("div",{className:"rq-reading-head",children:[t.jsx("h2",{children:u}),t.jsx("span",{className:"rq-clock",children:J8(s,a)})]}),t.jsx("ol",{className:"rq-steps",children:o.map(d=>t.jsxs("li",{className:`rq-step ${d.state}`,children:[t.jsx(JM,{s:d}),t.jsxs("div",{className:"rq-step-t",children:[t.jsxs("b",{children:[d.title,t.jsxs("span",{className:"sr-only",children:[": ",eF[d.state]]})]}),t.jsx("span",{children:d.sub}),d.bar&&d.state==="now"&&t.jsxs("span",{className:"rq-readbar",role:"progressbar","aria-valuemin":0,"aria-valuemax":d.bar.of,"aria-valuenow":d.bar.done,"aria-label":"How far the Analyst read",children:[t.jsx("i",{style:{flexGrow:Math.max(0,d.bar.done)}}),t.jsx("em",{style:{flexGrow:Math.max(0,d.bar.of-d.bar.done)}})]})]})]},d.key))}),t.jsxs("div",{className:"rq-reading-foot",children:[t.jsx("p",{children:"You can leave this page. Waiting for you tells you when the Analyst needs you."}),e.mine&&r&&t.jsxs("button",{className:"btn",disabled:c||n.isPending,title:`squad requirements stop ${e.id}`,onClick:()=>n.mutate({path:`${or(e.id)}/stop`,done:"Stopping the Analyst. Try again carries on from here."}),children:[t.jsx(us,{size:13})," ",c?"Stopping…":"Stop"]})]})]})}function nF({v:e}){const n=wt(),s=rn(),[r,a]=$.useState(!1),o=/^You stopped\b/.test(e.error??e.state.job?.error??""),c=o?"You stopped the Analyst":"The Analyst stopped";return t.jsx(lm,{calm:o,title:c,what:p7(e.error??e.state.job?.error??"The read did not get through.",c),safe:["Your document is saved.",...e.epics.length?["What the Analyst wrote so far is kept."]:[]],hint:t.jsx(se,{text:`squad requirements retry ${e.id}`}),ways:e.mine?[{label:"Try again",primary:!0,icon:t.jsx(qr,{size:14}),onClick:()=>n.mutate({path:`${or(e.id)}/retry`,done:"The Analyst carries on."}),disabled:n.isPending,title:`squad requirements retry ${e.id}`},...r?[{label:"Yes, delete it",icon:t.jsx(vn,{size:14}),title:`squad requirements delete ${e.id}`,disabled:n.isPending,onClick:()=>n.mutate({path:or(e.id),method:"DELETE",done:`Deleted ${e.id}.`},{onSuccess:()=>void s({to:"/requirements"})})},{label:"Keep it",onClick:()=>a(!1)}]:[{label:"Delete this breakdown",icon:t.jsx(vn,{size:14}),onClick:()=>a(!0),title:"Deletes the breakdown and its document"}]]:[]})}function sF({v:e,onOpenRef:n}){const s=wt(),[r,a]=$.useState(()=>Object.fromEntries(e.questions.filter(m=>m.answer).map(m=>[m.id,m.answer]))),o=e.questions,c=m=>{const y=r[m];return!!(y&&(y.choice!=="Other"||y.value?.trim()))},u=o.every(m=>c(m.id)),d=Kr(e.state.job)&&e.state.job?.step!=="reply",p=e.decided.length,f=()=>{if(!o.filter(x=>c(x.id)).length)return s.mutate({path:`${or(e.id)}/skip`,done:"The Analyst decides the open questions and writes each one down."});const y=Object.fromEntries(o.map(x=>[x.id,c(x.id)?r[x.id]:{choice:jx}]));s.mutate({path:`${or(e.id)}/answers`,body:{answers:y},done:"Answers sent. The Analyst decides the rest and writes the breakdown."})};return t.jsxs("div",{className:"rq-questions",children:[t.jsxs("div",{className:"rq-qhead",children:[t.jsx("span",{className:"rq-qn","aria-hidden":"true",children:o.length}),t.jsxs("h2",{children:["The Analyst has ",o.length," ",o.length===1?"question":"questions"]})]}),t.jsxs("p",{className:"rq-qlead",children:["The rest of the BRD is clear.",p>0&&` The Analyst decided ${p} small ${p===1?"thing":"things"} itself and wrote each one down. You will see them in the breakdown and can change any of them.`]}),e.state.job?.status==="failed"&&e.state.job.step==="reply"&&t.jsxs("div",{className:"rq-err",role:"alert",children:["The Analyst could not answer your question",e.state.job.error?`: ${e.state.job.error}`:"."," ",e.mine&&t.jsx("button",{className:"rq-link",onClick:()=>s.mutate({path:`${or(e.id)}/retry`,done:"The Analyst tries to answer again."}),children:"Try again"})]}),o.map((m,y)=>t.jsx(rF,{v:e,q:m,n:y+1,answer:r[m.id],onAnswer:x=>a(k=>({...k,[m.id]:x})),onOpenRef:n},m.id)),e.mine&&t.jsxs("div",{className:"rq-qfoot",children:[t.jsx(se,{text:`squad requirements answer ${e.id}`}),t.jsx("span",{className:"grow"}),t.jsx("button",{className:"btn",disabled:s.isPending||d,onClick:f,title:`squad requirements answer ${e.id} --skip`,children:jx}),t.jsxs("button",{className:"btn you",disabled:!u||s.isPending||d,onClick:()=>s.mutate({path:`${or(e.id)}/answers`,body:{answers:r},done:"Answers sent. The Analyst writes the breakdown now."}),children:[t.jsx(hs,{size:14})," Send answers"]})]})]})}function rF({v:e,q:n,n:s,answer:r,onAnswer:a,onOpenRef:o}){const c=wt(),[u,d]=we(e.id,`ask-${n.id}`,""),[p,f]=$.useState(!!u),m=`q-${e.id}-${n.id}`,y=()=>{u.trim()&&(c.mutate({path:`${or(e.id)}/questions/${n.id}/ask`,body:{text:u}},{onSuccess:()=>d("")}),f(!1))},x=r?.choice==="Other";return t.jsxs("fieldset",{className:"rq-q",children:[t.jsxs("legend",{className:"sr-only",children:["Question ",s]}),t.jsxs("div",{className:"rq-qtop",children:[t.jsx("span",{className:`rq-tag ${n.kind==="clash"?"clash":"gap"}`,children:n.kind==="clash"?"Two parts clash":"Missing in the BRD"}),t.jsxs("span",{className:"rq-qsrc",children:[(n.refs??[]).map((k,v)=>t.jsxs("span",{children:[v>0&&(v===(n.refs?.length??0)-1?" and ":", "),t.jsx("button",{className:"rq-link",onClick:()=>o(k),title:"Open this place in the document",children:s7(k)})]},v)),n.refs?.length&&n.impact?" · ":"",n.impact]})]}),t.jsx("div",{className:"rq-qt",children:n.text}),(n.thread?.length||n.thinking)&&t.jsxs("div",{className:"thread",children:[n.thread?.map((k,v)=>t.jsxs("div",{className:`msg ${k.who==="you"?"":"squad"}`,children:[t.jsx("small",{children:k.who==="you"?"You":$s[k.who]}),k.text]},v)),n.thinking&&t.jsxs("div",{className:"msg squad",children:[t.jsx("small",{children:"Analyst"}),t.jsxs("span",{className:"typing","aria-label":"Writing a reply",children:[t.jsx("i",{}),t.jsx("i",{}),t.jsx("i",{})]})]})]}),n.options.map(k=>t.jsxs("label",{className:`rq-opt ${r?.choice===k?"on":""}`,children:[t.jsx("input",{type:"radio",name:m,checked:r?.choice===k,onChange:()=>a({choice:k}),disabled:!e.mine}),k]},k)),t.jsxs("label",{className:`rq-opt ${x?"on":""}`,children:[t.jsx("input",{type:"radio",name:m,checked:x,onChange:()=>a({choice:"Other",value:r?.value??""}),disabled:!e.mine}),"Something else…"]}),x&&t.jsx("input",{className:"input rq-own",autoFocus:!0,"aria-label":"Your answer",placeholder:"Your answer",value:r?.value??"",onChange:k=>a({choice:"Other",value:k.target.value})}),e.mine&&(p?t.jsxs("div",{className:"askrow",children:[t.jsx("input",{className:"input",autoFocus:!0,value:u,onChange:k=>d(k.target.value),placeholder:"Ask the Analyst about this question","aria-label":"Your question to the Analyst",onKeyDown:k=>k.key==="Enter"&&y()}),t.jsx("button",{className:"btn",onClick:y,disabled:!u.trim()||c.isPending,children:"Ask"}),t.jsx("button",{className:"btn quiet",onClick:()=>f(!1),children:"Cancel"})]}):t.jsxs("button",{className:"asklink",onClick:()=>f(!0),disabled:n.thinking,title:`squad requirements ask ${e.id} ${n.id} "<text>"`,children:[t.jsx(Pn,{size:14})," Ask about this"]}))]})}const Lr=e=>`/api/v1/requirements/${encodeURIComponent(e)}`,eu={epic:"Epic",feature:"Feature",story:"Story"};function No(e){return e.mine&&(e.status==="ready"||e.status==="approved")}function iF(e){const n=e.state.job;return Kr(n)&&n?.step==="redo"?n.item??null:null}function _b(e,n){const s=iF(e);if(!s)return!1;if(s===e.id||s===n)return!0;const r=Vn(e,s);return!r||r.level==="story"?!1:Yr(r.item).some(a=>a.key===n)||r.level==="epic"&&r.epic.features.some(a=>a.key===n)}function hp({v:e,mode:n,selected:s,open:r,onToggle:a,onSelect:o,onDecide:c,onAdd:u}){const d=$.useMemo(()=>new Map(e.progress.map(x=>[x.key,x])),[e.progress]),p=Vn(e,s),f=p?p.level==="epic"?p.epic.features[0]?.key??p.epic.key:p.feature?.key??p.epic.key:void 0,m=p?.epic.key,y=(x,k)=>t.jsx(oF,{s:x,p:d.get(x.key),depth:k,mode:n,selected:s===x.key,onSelect:o,onDecide:c},x.key);return t.jsxs("section",{className:`rq-tree ${n} ${e.epics.some(x=>Yr(x).some(k=>k.tracker))?"refs":""} ${o?"":"still"}`,"aria-label":"Breakdown",children:[e.epics.map(x=>{const k=r.has(x.key);return t.jsxs("div",{className:"rq-group",children:[t.jsx(c2,{level:"epic",item:x,depth:0,mode:n,isOpen:k,selected:s===x.key,progress:d,onToggle:a,onSelect:o}),k&&t.jsxs(t.Fragment,{children:[x.features.map(v=>{const b=r.has(v.key);return t.jsxs("div",{className:"rq-sub",children:[t.jsx(c2,{level:"feature",item:v,depth:1,mode:n,isOpen:b,selected:s===v.key,progress:d,onToggle:a,onSelect:o}),b&&v.stories.map(N=>y(N,2)),b&&!v.stories.length&&t.jsx("div",{className:"rq-none d2",children:"No stories yet."})]},v.key)}),x.stories.map(v=>y(v,1)),!x.features.length&&!x.stories.length&&t.jsx("div",{className:"rq-none d1",children:"Nothing under this epic yet."})]})]},x.key)}),!e.epics.length&&t.jsx("p",{className:"note rq-none",children:"No epics yet."}),u&&No(e)&&t.jsxs("div",{className:"rq-adds",children:[t.jsxs("button",{className:"btn rq-addbtn",onClick:()=>u("epic"),title:`squad requirements add-item ${e.id} --title "…"`,children:[t.jsx(Tt,{size:14})," Add an epic"]}),e.epics.length>0&&t.jsxs("button",{className:"btn rq-addbtn",onClick:()=>u("feature",m??e.epics.at(-1)?.key),children:[t.jsx(Tt,{size:14})," Add a feature"]}),e.epics.length>0&&t.jsxs("button",{className:"btn rq-addbtn",onClick:()=>u("story",f),children:[t.jsx(Tt,{size:14})," Add a story"]})]})]})}function Ob({done:e,of:n}){return t.jsx("span",{className:"rq-pb","aria-hidden":"true",children:t.jsx("b",{style:{width:`${n?Math.round(e/n*100):0}%`}})})}function c2({level:e,item:n,depth:s,mode:r,isOpen:a,selected:o,progress:c,onToggle:u,onSelect:d}){const p=Yr(n),f=Dc(p,c),m=e==="feature"?p.filter(x=>c.get(x.key)?.state==="building").map(x=>x.key):[],y=e==="epic"?n.goal:void 0;return t.jsxs("div",{className:`rq-row ${e} d${s} ${o?"sel":""}`,children:[t.jsx("button",{className:"rq-fold","aria-expanded":a,"aria-label":`${a?"Fold":"Open"} ${n.title}`,onClick:()=>u(n.key),children:a?t.jsx(Cf,{size:14,strokeWidth:2.4}):t.jsx(lu,{size:14,strokeWidth:2.4})}),t.jsxs(qb,{onClick:d&&(()=>d(n.key)),current:o,label:`${eu[e]} ${n.key} ${n.title}`,children:[t.jsx("span",{className:`rq-lv ${e}`,children:eu[e]}),t.jsx("span",{className:"rq-t",title:n.title,children:n.title}),r==="plan"&&y&&t.jsx("span",{className:"rq-meta rq-goal",children:y}),r==="build"&&m.length>0&&t.jsxs("span",{className:"rq-meta rq-live",children:[m.join(", ")," building"]}),t.jsx("span",{className:"grow"}),r==="plan"?t.jsx("span",{className:"rq-meta",children:Kk(n)}):t.jsxs(t.Fragment,{children:[t.jsx(Ob,{...f}),t.jsxs("span",{className:"rq-meta rq-of",children:[f.done," of ",f.of]})]})]})]})}function qb({onClick:e,current:n,label:s,children:r}){return e?t.jsx("button",{className:"rq-main",onClick:e,"aria-current":n?"true":void 0,"aria-label":s,children:r}):t.jsx("div",{className:"rq-main",children:r})}function aF({p:e}){const n=If(e?.state);return t.jsxs("span",{className:`rq-st ${n} ${e?.state??"not-started"}`,children:[n==="m"?t.jsx(xe,{size:13,strokeWidth:3,"aria-hidden":"true"}):n==="b"?t.jsx("span",{className:"live","aria-hidden":"true"}):null,t.jsx("span",{className:"rq-stl",children:e?.line??"Not started"})]})}function oF({s:e,p:n,depth:s,mode:r,selected:a,onSelect:o,onDecide:c}){const u=n?.state==="needs-you",d=e.tracker;return t.jsxs("div",{className:`rq-row story d${s} ${a?"sel":""} ${u?"you":""}`,onClick:o&&(()=>o(e.key)),children:[t.jsxs(qb,{onClick:o&&(()=>o(e.key)),current:a,label:`Story ${e.key} ${e.title}${n&&r==="build"?`: ${n.line}`:""}`,children:[r==="plan"&&t.jsx("span",{className:"rq-lv story",children:"Story"}),t.jsx("span",{className:"rq-id",children:e.key}),t.jsx("span",{className:"rq-t",title:e.title,children:e.title}),r==="plan"&&t.jsxs(t.Fragment,{children:[e.dependsOn.slice(0,2).map(p=>t.jsxs("span",{className:"rq-need",children:["needs ",p]},p)),e.dependsOn.length>2&&t.jsxs("span",{className:"rq-need",children:["+",e.dependsOn.length-2]}),!e.criteria.length&&t.jsx("span",{className:"rq-warn",children:'No "done when" yet'}),t.jsx("span",{className:"grow"}),e.ref?.section&&t.jsx("span",{className:"rq-meta rq-from",children:n7(e.ref.section)}),t.jsx("span",{className:"rq-meta rq-size",title:`Size ${e.size}`,children:e.size})]}),r==="build"&&t.jsx("span",{className:"rq-tk",children:n?.ticket??e.ticket??"–"})]}),r==="build"&&(d?.url?t.jsx("a",{className:"rq-ref",href:d.url,target:"_blank",rel:"noreferrer",title:`Open ${d.ref}`,onClick:p=>p.stopPropagation(),children:d.ref}):t.jsx("span",{className:"rq-ref",children:d?.ref??""})),r==="build"&&t.jsxs("span",{className:`rq-stcol ${u?"you":""}`,children:[t.jsx(aF,{p:n}),u&&n?.ticket&&t.jsx("button",{className:"btn you sm",onClick:p=>{p.stopPropagation(),c(n.ticket)},"aria-label":`Decide on ${e.key} ${e.title}`,children:"Decide"})]})]})}function lF(e){const n=Vn(e.v,e.k);return n?n.level==="story"?t.jsx(uF,{...e,f:n},n.item.key):t.jsx(dF,{...e,f:n},n.item.key):null}function Db({f:e,onClose:n}){return t.jsxs("div",{className:"rq-ph",children:[t.jsx("span",{className:`rq-lv ${e.level}`,children:eu[e.level]}),t.jsx("span",{className:"rq-id",children:e.item.key}),t.jsx("span",{className:"rq-place",children:r7(e)}),t.jsx("span",{className:"grow"}),t.jsx("button",{className:"iconbtn","aria-label":"Close",onClick:n,children:t.jsx(Xe,{size:15})})]})}const cF=e=>({title:e.title,story:e.story,criteria:e.criteria.map(n=>({...n})),size:e.size,needs:[...e.dependsOn]}),Xa=(e,n)=>JSON.stringify(e)===JSON.stringify(n);function Bb(e,n,s){const r=go(gt,e,`panel-${n}`),[a,o]=$.useState(()=>Kc(r)??s),[c,u]=$.useState({key:n,server:s}),d=!Xa(a,c.server);return $.useEffect(()=>{d&&n===c.key?wj(r,a):xo(r)},[r,a,d]),$.useEffect(()=>{if(n!==c.key){o(s),u({key:n,server:s});return}Xa(s,c.server)||(!d||Xa(a,s))&&(o(s),u({key:n,server:s}))},[n,s]),[a,o,d&&n===c.key,()=>o(c.server)]}function uF({v:e,f:n,onClose:s,onSelect:r,onAsk:a,onOpenRef:o,onOpenTicket:c}){const u=n.story,d=wt(),{toast:p}=qe(),f=e.progress.find(q=>q.key===u.key),m=!!u.ticket,y=_b(e,u.key),x=No(e)&&!m&&!y,k=$.useMemo(()=>cF(u),[u]),[v,b,N,C]=Bb(e.id,u.key,k),[S,P]=$.useState(!1),[M,T]=$.useState(!1),F=e.decided.filter(q=>q.item===u.key),R=c7(e,u),B=e.status==="approved",I=q=>Vn(e,q)?.item.title??"",O=()=>{const q=Cx(v.criteria);if(q.length!==v.criteria.length&&b(ce=>({...ce,criteria:Cx(ce.criteria)})),q.some(Lh)){T(!0),requestAnimationFrame(()=>[...document.querySelectorAll(".rq-gwt.half textarea")].find(ce=>!ce.value.trim())?.focus());return}T(!1);const K={};v.title!==u.title&&(K.title=v.title),v.story!==u.story&&(K.story=v.story),Xa(q,u.criteria)||(K.criteria=q),v.size!==u.size&&(K.size=v.size),Xa(v.needs,u.dependsOn)||(K.needs=v.needs),Object.keys(K).length&&d.mutate({path:`${Lr(e.id)}/items/${u.key}`,method:"PATCH",body:K,done:`Saved ${u.key}.`})},_=(q,K,ce)=>b(H=>({...H,criteria:H.criteria.map((V,ne)=>ne===q?{...V,[K]:ce}:V)})),Q=UP(e,u.key,v.needs);return t.jsxs("aside",{className:"rq-panel","aria-label":`Story ${u.key}`,"data-dirty":N,children:[t.jsx(Db,{f:n,onClose:s}),t.jsxs("div",{className:"rq-pbody",children:[m&&t.jsxs("div",{className:`rq-started ${If(f?.state)}`,children:[t.jsxs("span",{children:[t.jsx("b",{className:"mono",children:u.ticket})," ",f?.line??""]}),t.jsx("button",{className:`btn sm ${f?.state==="needs-you"?"you":""}`,onClick:()=>c(u.ticket),children:f?.state==="needs-you"?"Decide":"Open the ticket"})]}),m&&t.jsxs("p",{className:"note",children:["It started as ",u.ticket,", so it changes on its ticket now."]}),y&&t.jsx("p",{className:"rq-busy",children:"The Analyst is redoing this part. It shows here when it is done."}),t.jsxs("div",{className:"field",children:[t.jsx("label",{htmlFor:"rq-st",children:"Title"}),x?t.jsx("input",{id:"rq-st",className:"input rq-titlein",value:v.title,onChange:q=>b(K=>({...K,title:q.target.value}))}):t.jsx("div",{id:"rq-st",className:"rq-ro rq-titlein",children:u.title})]}),t.jsxs("div",{className:"field",children:[t.jsx("label",{htmlFor:"rq-ss",children:"Story"}),x?t.jsx("textarea",{id:"rq-ss",className:"textarea rq-storyin",value:v.story,placeholder:"As a …, I want …, so that …",onChange:q=>b(K=>({...K,story:q.target.value}))}):t.jsx("div",{id:"rq-ss",className:"rq-ro",children:u.story||t.jsx("span",{className:"note",children:"No story text yet."})})]}),t.jsx("div",{className:"rq-lab",children:"Done when"}),t.jsxs("div",{className:"rq-gwts",children:[v.criteria.map((q,K)=>t.jsxs("div",{className:`rq-gwt ${M&&Lh(q)?"half":""}`,children:[["given","when","then"].map(ce=>t.jsxs("label",{className:"rq-gwtrow",children:[t.jsx("b",{children:ce.charAt(0).toUpperCase()+ce.slice(1)}),x?t.jsx("textarea",{rows:Math.max(1,Math.ceil(q[ce].length/40)),value:q[ce],onChange:H=>_(K,ce,H.target.value.replace(/\n/g," ")),"aria-label":`Check ${K+1}: ${ce}`}):t.jsx("span",{children:q[ce]})]},ce)),x&&t.jsx("button",{className:"rq-gwt-x","aria-label":`Remove check ${K+1}`,onClick:()=>b(ce=>({...ce,criteria:ce.criteria.filter((H,V)=>V!==K)})),children:t.jsx(Xe,{size:13})}),M&&Lh(q)&&t.jsx("p",{className:"rq-halfnote",role:"alert",children:"Fill in Given, When and Then, or remove this check. Your other changes are kept."})]},K)),!v.criteria.length&&t.jsx("p",{className:"rq-warnline",children:'No "done when" yet. A story needs at least one before you approve.'}),x&&t.jsx("button",{className:"rq-link",onClick:()=>b(q=>({...q,criteria:[...q.criteria,{given:"",when:"",then:""}]})),children:"+ Add a check"})]}),t.jsxs("div",{className:"rq-two",children:[t.jsxs("div",{className:"grow",children:[t.jsx("div",{className:"rq-lab",children:"Needs"}),t.jsxs("div",{className:"rq-needs",children:[v.needs.map(q=>t.jsxs("span",{className:"rq-need big",children:[t.jsxs("button",{className:"rq-needname",onClick:()=>r(q),title:`Open ${q} ${I(q)}`,children:[t.jsx("b",{children:q}),t.jsx("span",{children:I(q)})]}),x&&t.jsx("button",{"aria-label":`${u.key} does not need ${q}`,onClick:()=>b(K=>({...K,needs:K.needs.filter(ce=>ce!==q)})),children:t.jsx(Xe,{size:11})})]},q)),!v.needs.length&&!x&&t.jsx("span",{className:"note",children:"Nothing first"}),x&&Q.length>0&&t.jsxs("select",{className:"rq-addneed","aria-label":`Add a story ${u.key} needs first`,value:"",onChange:q=>q.target.value&&b(K=>({...K,needs:[...K.needs,q.target.value]})),children:[t.jsx("option",{value:"",children:"+ Add"}),Q.map(q=>t.jsx("option",{value:q.key,children:q.label},q.key))]})]})]}),t.jsxs("div",{children:[t.jsx("div",{className:"rq-lab",children:"Size"}),t.jsx("div",{className:"seg rq-sizeseg",role:"group","aria-label":"Size",children:["S","M","L"].map(q=>t.jsx("button",{className:v.size===q?"on":"","aria-pressed":v.size===q,disabled:!x,onClick:()=>b(K=>({...K,size:q})),children:q},q))})]})]}),x&&t.jsx(Wb,{v:e,f:n}),u.ref&&t.jsxs("div",{className:"rq-fromline",children:["From the BRD:"," ",t.jsx("button",{className:"rq-link",onClick:()=>o(u.ref),children:Mo(u.ref)})]}),F.length>0&&t.jsxs("div",{className:"rq-dbox",children:[t.jsx("div",{className:"rq-lab",children:"Decided for you"}),F.map(q=>t.jsx(Mm,{v:e,d:q,compact:!0,onOpenTicket:c},`${q.ticket??""}${q.id}`))]}),B&&!m&&t.jsxs("div",{className:"rq-startbox",children:[t.jsxs("button",{className:"btn",disabled:R.length>0||d.isPending||!e.mine||!u.criteria.length||N,onClick:()=>d.mutate({path:`${Lr(e.id)}/items/${u.key}/start`},{onSuccess:q=>p(`${u.key} started as ${q.ticket?.id??"a ticket"}. It builds by itself.`)}),title:`squad requirements start ${e.id} ${u.key}`,children:[t.jsx(Wi,{size:13})," Start this story now"]}),t.jsx("span",{className:"note",children:R.length?`It starts after ${R.join(", ")} ${R.length===1?"merges":"merge"}.`:N?"Save your changes first.":"It becomes a ticket that builds by itself."})]}),!m&&t.jsx(se,{text:B?`squad requirements start ${e.id} ${u.key}`:`squad requirements edit ${e.id} ${u.key} --title ${Le(v.title)}`})]}),x&&t.jsx("div",{className:"rq-pf",children:S?t.jsxs(t.Fragment,{children:[t.jsxs("span",{className:"rq-sure",children:["Remove ",u.key,"? It goes out of other stories' needs too."]}),t.jsx("button",{className:"btn danger",onClick:()=>d.mutate({path:`${Lr(e.id)}/items/${u.key}`,method:"DELETE",done:`Removed ${u.key}.`},{onSuccess:()=>r(void 0)}),children:"Remove"}),t.jsx("button",{className:"btn",onClick:()=>P(!1),children:"Keep it"})]}):t.jsxs(t.Fragment,{children:[t.jsx("button",{className:"btn",onClick:()=>a(u.key),title:`squad requirements redo ${e.id} ${u.key} "<what to change>"`,children:"Ask the Analyst to redo this"}),N?t.jsx("button",{className:"btn quiet",onClick:()=>{C(),T(!1)},children:"Undo"}):t.jsx("button",{className:"btn quiet",onClick:()=>P(!0),title:`squad requirements remove ${e.id} ${u.key}`,children:"Remove"}),t.jsx("span",{className:"grow"}),t.jsx("button",{className:"btn pri",disabled:!N||d.isPending,onClick:O,children:"Save"})]})})]})}function Wb({v:e,f:n}){const s=wt(),r=i7(e,n),a=a7(n);return r.length<2?null:t.jsxs("div",{className:"field rq-move",children:[t.jsx("label",{htmlFor:`rq-move-${n.item.key}`,children:"Move to"}),t.jsx("select",{id:`rq-move-${n.item.key}`,className:"select",value:a,title:`squad requirements move ${e.id} ${n.item.key} --under <key>`,onChange:o=>o.target.value!==a&&s.mutate({path:`${Lr(e.id)}/items/${n.item.key}/move`,body:{under:o.target.value},done:`Moved ${n.item.key}.`}),children:r.map(o=>t.jsx("option",{value:o.key,children:o.label},o.key))})]})}function dF({v:e,f:n,onClose:s,onSelect:r,onAsk:a,onOpenRef:o,onOpenTicket:c,onAdd:u}){const d=wt(),p=n.level==="epic",f=n.item,m=p?f.goal??"":f.summary??"",y=$.useMemo(()=>({title:f.title,about:m}),[f.title,m]),[x,k,v,b]=Bb(e.id,f.key,y),[N,C]=$.useState(!1),S=_b(e,f.key),P=Yr(f),M=P.filter(O=>O.ticket),T=No(e)&&!S,F=new Map(e.progress.map(O=>[O.key,O])),R=Dc(P,F),B=e.decided.filter(O=>O.item===f.key),I=()=>d.mutate({path:`${Lr(e.id)}/items/${f.key}`,method:"PATCH",body:{...x.title!==f.title?{title:x.title}:{},...x.about!==m?p?{goal:x.about}:{summary:x.about}:{}},done:`Saved ${f.key}.`});return t.jsxs("aside",{className:"rq-panel","aria-label":`${eu[n.level]} ${f.key}`,"data-dirty":v,children:[t.jsx(Db,{f:n,onClose:s}),t.jsxs("div",{className:"rq-pbody",children:[S&&t.jsx("p",{className:"rq-busy",children:"The Analyst is redoing this part. It shows here when it is done."}),t.jsxs("div",{className:"field",children:[t.jsx("label",{htmlFor:"rq-gt",children:"Title"}),T?t.jsx("input",{id:"rq-gt",className:"input rq-titlein",value:x.title,onChange:O=>k(_=>({..._,title:O.target.value}))}):t.jsx("div",{id:"rq-gt",className:"rq-ro rq-titlein",children:f.title})]}),t.jsxs("div",{className:"field",children:[t.jsx("label",{htmlFor:"rq-ga",children:p?"What it is for":"What it covers"}),T?t.jsx("textarea",{id:"rq-ga",className:"textarea rq-storyin",value:x.about,onChange:O=>k(_=>({..._,about:O.target.value}))}):t.jsx("div",{id:"rq-ga",className:"rq-ro",children:m||t.jsx("span",{className:"note",children:"Nothing written yet."})})]}),t.jsxs("div",{className:"rq-stats",children:[t.jsx("span",{children:Kk(f)}),e.status==="approved"&&P.length>0&&t.jsxs("span",{children:[t.jsx(Ob,{...R})," ",R.done," of ",R.of," merged"]})]}),T&&n.level==="feature"&&t.jsx(Wb,{v:e,f:n}),f.ref&&t.jsxs("div",{className:"rq-fromline",children:["From the BRD:"," ",t.jsx("button",{className:"rq-link",onClick:()=>o(f.ref),children:Mo(f.ref)})]}),B.length>0&&t.jsxs("div",{className:"rq-dbox",children:[t.jsx("div",{className:"rq-lab",children:"Decided for you"}),B.map(O=>t.jsx(Mm,{v:e,d:O,compact:!0,onOpenTicket:c},`${O.ticket??""}${O.id}`))]}),No(e)&&t.jsxs("div",{className:"rq-hereadds",children:[p&&t.jsx("button",{className:"rq-link",onClick:()=>u("feature",f.key),children:"+ Add a feature here"}),t.jsx("button",{className:"rq-link",onClick:()=>u("story",p?f.features[0]?.key??f.key:f.key),children:"+ Add a story here"})]}),t.jsx(se,{text:`squad requirements edit ${e.id} ${f.key} --title ${Le(x.title)}`})]}),T&&t.jsx("div",{className:"rq-pf",children:N?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"rq-sure",children:M.length?`${f.key} has stories that started, so it stays. Move them out first.`:`Remove ${f.key} and the ${P.length} ${P.length===1?"story":"stories"} under it?`}),!M.length&&t.jsxs("button",{className:"btn danger",onClick:()=>d.mutate({path:`${Lr(e.id)}/items/${f.key}`,method:"DELETE",done:`Removed ${f.key}.`},{onSuccess:()=>r(void 0)}),children:[t.jsx(vn,{size:13})," Remove"]}),t.jsx("button",{className:"btn",onClick:()=>C(!1),children:M.length?"OK":"Keep it"})]}):t.jsxs(t.Fragment,{children:[t.jsx("button",{className:"btn",onClick:()=>a(f.key),title:`squad requirements redo ${e.id} ${f.key} "<what to change>"`,children:"Ask the Analyst to redo this"}),v?t.jsx("button",{className:"btn quiet",onClick:b,children:"Undo"}):t.jsx("button",{className:"btn quiet",onClick:()=>C(!0),title:`squad requirements remove ${e.id} ${f.key}`,children:"Remove"}),t.jsx("span",{className:"grow"}),t.jsx("button",{className:"btn pri",disabled:!v||!x.title.trim()||d.isPending,onClick:I,children:"Save"})]})})]})}function Mm({v:e,d:n,compact:s,onSelect:r,onOpenTicket:a}){const o=wt(),{toast:c}=qe(),[u,d]=we(n.ticket??e.id,`decided-${n.id}`,""),[p,f]=$.useState(!!u),m=n.ticket?`/api/v1/tickets/${encodeURIComponent(n.ticket)}/decided/${n.id}`:`${Lr(e.id)}/decided/${n.id}`,y=n.ticket?`squad decided ${n.ticket} ${n.id} ${Le(u.trim()||"<text>")}`:`squad requirements decided ${e.id} ${n.id} ${Le(u.trim()||"<text>")}`,x=()=>o.mutate({path:m,body:{text:u.trim()},...n.ticket?{}:{done:`Changed. The Analyst redoes ${n.item??"the breakdown"} with it.`}},{onSuccess:b=>{f(!1),d(""),n.ticket&&c(Zk(n.ticket,b?.decided?.find(N=>N.id===n.id)?.changed?.ticket))}}),k=n.changed?.ticket,v=k?/^c\d+$/.test(k)?n.ticket:k:void 0;return t.jsxs("div",{className:`rq-dec ${s?"compact":""}`,children:[!s&&t.jsx("div",{className:"rq-dw",children:r&&n.item?t.jsx("button",{className:"rq-link mono",onClick:()=>r(n.item),children:Sx(n)}):Sx(n)}),n.changed?t.jsxs("div",{className:"rq-dt",children:[n.changed.text,t.jsxs("span",{className:"rq-was",children:["Was: ",n.text,k&&t.jsxs(t.Fragment,{children:[" · ",v&&a?t.jsx("button",{className:"rq-link rq-now",onClick:()=>a(v),title:`Open ${v}`,children:/^c\d+$/.test(k)?`now change ${k} on ${n.ticket}`:`now ${k}`}):/^c\d+$/.test(k)?`now change ${k} on ${n.ticket}`:`now ${k}`]})]})]}):t.jsxs("div",{className:"rq-dt",children:[n.text,s&&n.by==="answer"&&t.jsx("span",{className:"rq-was",children:"From your answer"})]}),p?t.jsxs("div",{className:"rq-dedit",children:[t.jsx("textarea",{className:"textarea",autoFocus:!0,value:u,onChange:b=>d(b.target.value),"aria-label":"What you want instead",placeholder:"What should it be instead?"}),t.jsxs("div",{className:"rq-dedit-b",children:[t.jsx("button",{className:"btn sm pri",disabled:!u.trim()||o.isPending,onClick:x,children:"Save change"}),t.jsx("button",{className:"btn sm",onClick:()=>f(!1),children:"Cancel"}),t.jsx(se,{text:y})]})]}):!n.changed&&e.mine&&t.jsx("button",{className:"rq-link",onClick:()=>f(!0),"aria-label":`Change: ${n.text}`,children:"Change"})]})}function hF({v:e,onSelect:n,onOpenTicket:s,onClose:r}){const[a,o]=$.useState(!1),c=e.decided,u=a?c:c.slice(0,5),d=e.status==="approved"&&e.progress.some(p=>p.ticket);return t.jsx("aside",{className:"rq-panel rq-decided","aria-label":"Decided for you",children:t.jsxs("div",{className:"rq-pbody",children:[t.jsxs("div",{className:"rq-dtop",children:[t.jsxs("h2",{className:"rq-dhead",children:["Decided for you ",t.jsx("span",{children:c.length})]}),r&&t.jsx("button",{className:"iconbtn rq-dclose","aria-label":"Close",onClick:r,children:t.jsx(Xe,{size:15})})]}),t.jsxs("p",{className:"rq-dlead",children:["Small choices the squad made where the BRD says nothing. Change one and ",d?"it becomes a small change ticket":"the Analyst redoes the part it is about","."]}),u.map(p=>t.jsx(Mm,{v:e,d:p,onSelect:n,onOpenTicket:s},`${p.ticket??""}${p.id}`)),!c.length&&t.jsx("p",{className:"note",children:"Nothing yet. When the squad decides a small thing itself, it shows here."}),c.length>5&&t.jsx("button",{className:"rq-link rq-showall",onClick:()=>o(!a),children:a?"Show fewer":`Show all ${c.length}`})]})})}const mc={min:.3,max:1.6,step:.1},u2=e=>Math.round(e*100)/100;function pF({v:e,selected:n,onSelect:s,onDecide:r}){const a=$.useMemo(()=>m7(e),[e.epics,e.progress]),o=$.useMemo(()=>new Map(a.boxes.map(H=>[H.key,H])),[a]),c=$.useRef(null),[u,d]=$.useState(1),[p,f]=$.useState(null),m=$.useMemo(()=>new Map(e.progress.map(H=>[H.key,H])),[e.progress]),y=e.progress.filter(H=>H.state==="needs-you").map(H=>H.key),[x,k]=$.useState(y[0]??null),v=Qe(),b=v.data?.ready?v.data.tickets:[],N=x?o.get(x):void 0,C=N?g7(a,N):null,S=C?.height??a.height,P=()=>{const H=c.current;H&&d(x7({width:a.width,height:S},{width:H.clientWidth-16,height:H.clientHeight-16}))};$.useLayoutEffect(()=>{const H=c.current;H&&d(y7(a,{width:H.clientWidth-16}))},[]),$.useEffect(()=>{x&&!y.includes(x)&&k(y[0]??null)},[y.join()]);const M=$.useRef(null),T=H=>{if(H.target.closest("button"))return;const V=c.current;M.current={x:H.clientX,y:H.clientY,left:V.scrollLeft,top:V.scrollTop},V.setPointerCapture(H.pointerId)},F=H=>{const V=M.current;V&&(c.current.scrollLeft=V.left-(H.clientX-V.x),c.current.scrollTop=V.top-(H.clientY-V.y))},R=()=>M.current=null,I=Vn(e,p??n??null??void 0),O=I?.story?[...I.story.dependsOn.map(H=>({from:H,to:I.story.key})),...wx(e,I.story.key).map(H=>({from:I.story.key,to:H}))].filter(H=>o.has(H.from)&&o.has(H.to)):[],_=x?m.get(x):void 0,Q=_?.ticket?b.find(H=>H.id===_.ticket):void 0,q=x?wx(e,x):[],K=Q?.agentQuestion?.text?Qk(Q.agentQuestion.text):Q?.waiting?.summary??Vn(e,x??void 0)?.item.title??"",ce=H=>{H.level==="story"&&m.get(H.key)?.state==="needs-you"?k(H.key):(k(null),s(H.key))};return t.jsxs("div",{className:"rq-map",children:[t.jsxs("div",{className:"rq-zoom",role:"group","aria-label":"Zoom",children:[t.jsx("button",{className:"btn sm","aria-label":"Zoom out",onClick:()=>d(H=>Math.max(mc.min,u2(H-mc.step))),children:"−"}),t.jsx("button",{className:"btn sm","aria-label":"Zoom in",onClick:()=>d(H=>Math.min(mc.max,u2(H+mc.step))),children:"+"}),t.jsx("button",{className:"btn sm",onClick:P,children:"Fit"})]}),t.jsx("div",{className:"rq-mapview",ref:c,onPointerDown:T,onPointerMove:F,onPointerUp:R,onPointerCancel:R,children:t.jsx("div",{className:"rq-mapsize",style:{width:a.width*u,height:S*u},children:t.jsxs("div",{className:"rq-mapcanvas",style:{width:a.width,height:S,transform:`scale(${u})`},children:[t.jsxs("svg",{className:"rq-lines",width:a.width,height:S,"aria-hidden":"true",children:[a.lines.map((H,V)=>t.jsx("line",{x1:H.x1,y1:H.y1,x2:H.x2,y2:H.y2},V)),O.map(H=>{const V=o.get(H.from),ne=o.get(H.to),A=Math.abs(V.x-ne.x)<2,D=A?V.x+V.w:V.x+(ne.x>V.x?V.w:0),ee=A?ne.x+ne.w:ne.x+(ne.x>V.x?0:ne.w),z=V.y+V.h/2,me=ne.y+ne.h/2,he=A?34:Math.max(30,Math.abs(ee-D)/2),ke=A?D+he:D+(ne.x>V.x?he:-he),Re=A?ee+he:ee+(ne.x>V.x?-he:he);return t.jsx("path",{className:"rq-needline",d:`M${D},${z} C${ke},${z} ${Re},${me} ${ee},${me}`,markerEnd:"url(#rq-arrow)"},`${H.from}-${H.to}`)}),t.jsx("defs",{children:t.jsx("marker",{id:"rq-arrow",viewBox:"0 0 8 8",refX:"7",refY:"4",markerWidth:"7",markerHeight:"7",orient:"auto-start-reverse",children:t.jsx("path",{d:"M0,0 L8,4 L0,8 z",className:"rq-arrowhead"})})})]}),a.boxes.map(H=>{const V=m.get(H.key),ne={left:H.x,top:H.y,width:H.w,height:H.h};if(H.level==="story")return t.jsx("button",{className:`rq-chip ${If(H.state)} ${n===H.key?"sel":""}`,style:ne,title:`${H.key} ${H.title}${V?`: ${V.line}`:""}`,"aria-label":`Story ${H.key} ${H.title}${V?`: ${V.line}`:""}`,onClick:()=>ce(H),onMouseEnter:()=>f(H.key),onMouseLeave:()=>f(null),onFocus:()=>f(H.key),onBlur:()=>f(null),children:t.jsxs("span",{className:"rq-chipt",children:[t.jsx("em",{children:H.key})," ",H.title]})},H.key);const A=H.done?.of?Math.round(H.done.done/H.done.of*100):0;return t.jsxs("button",{className:`rq-box ${H.level} ${n===H.key?"sel":""}`,style:ne,onClick:()=>ce(H),title:H.title,"aria-label":`${H.level==="epic"?"Epic":"Feature"} ${H.key} ${H.title}, ${H.done?.done??0} of ${H.done?.of??0} merged`,children:[t.jsx("span",{className:"n",children:H.title}),t.jsxs("span",{className:"p",children:[t.jsx("i",{children:t.jsx("b",{style:{width:`${A}%`}})}),H.level==="epic"?`${H.done?.done??0} of ${H.done?.of??0}`:`${H.done?.done??0}/${H.done?.of??0}`]})]},H.key)}),N&&_&&C&&t.jsxs("div",{className:"rq-pop",style:{left:C.left,top:C.top,width:bs.popW},role:"dialog","aria-label":`${N.key} needs you`,children:[t.jsx("button",{className:"rq-pop-x","aria-label":"Close",onClick:()=>k(null),children:t.jsx(Xe,{size:13})}),t.jsx("div",{className:"rq-pop-w",children:[N.key,_.ticket,Yk(_.stop)].filter(Boolean).join(" · ")}),t.jsx("div",{className:"rq-pop-t",children:K}),t.jsxs("div",{className:"rq-pop-s",children:[q.length?`${q.join(", ")} ${q.length===1?"waits":"wait"} for it. `:"",e.state.build?.on?"Everything else keeps going.":""]}),_.ticket&&t.jsx("button",{className:"btn sm you",onClick:()=>r(_.ticket),children:"Decide"})]})]})})}),t.jsxs("div",{className:"rq-legend",children:[t.jsxs("span",{className:"k",children:[t.jsx("i",{className:"m"}),"Merged"]}),t.jsxs("span",{className:"k",children:[t.jsx("i",{className:"b"}),"Building"]}),t.jsxs("span",{className:"k",children:[t.jsx("i",{className:"y"}),"Needs you"]}),t.jsxs("span",{className:"k",children:[t.jsx("i",{className:"w"}),"Not started"]}),t.jsx("span",{children:"Click a box to open it. Drag to move around."})]})]})}const _r=e=>`/api/v1/requirements/${encodeURIComponent(e)}`;function Ub({text:e,tone:n}){return t.jsxs("span",{className:`rq-chip-s ${n}`,children:[t.jsx("i",{"aria-hidden":"true"}),e]})}function fF(){const e=Rj(),n=Qe(),s=n.data?.ready?n.data.meta.user?.name:void 0,[r,a]=$.useState(!1),o=e.data?.breakdowns??[];return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"top",children:[t.jsx("h1",{children:"Requirements"}),t.jsx("span",{className:"grow"}),t.jsx(se,{text:"squad requirements list"}),t.jsxs("button",{className:"btn pri",onClick:()=>a(!0),children:[t.jsx(Tt,{size:15})," Add a BRD"]})]}),t.jsx("div",{className:"scroll",children:t.jsx("div",{className:"page rq-list",children:e.isLoading?t.jsx("p",{className:"note",children:"Reading your breakdowns…"}):e.isError?t.jsxs("p",{className:"rq-err",role:"alert",children:["squad-kit could not read the breakdowns. ",_i(e.error)]}):o.length?t.jsxs(t.Fragment,{children:[t.jsx("p",{className:"note rq-lead",children:"Each BRD you add is one breakdown. Open one to edit it, approve it, send it or build it."}),t.jsx("div",{className:"rq-rows",children:o.map(c=>t.jsx(mF,{r:c,me:s},c.id))})]}):t.jsxs("div",{className:"rq-empty",children:[t.jsx("span",{className:"ring",children:t.jsx(kk,{size:20})}),t.jsxs("div",{children:[t.jsx("h2",{children:"Turn a BRD into stories the squad can build"}),t.jsx("p",{children:"Add your business requirements document: a PDF, a Word file, Markdown or text. The Analyst reads it, asks you only about parts that are missing or that clash, and breaks it into epics, features and stories for you to edit and approve. Nothing is built or sent anywhere until you approve."}),t.jsxs("button",{className:"btn pri",onClick:()=>a(!0),children:[t.jsx(Tt,{size:15})," Add a BRD"]})]})]})})}),r&&t.jsx(LP,{onClose:()=>a(!1)})]})}function mF({r:e,me:n}){const[s,r]=$.useState(!1),a=V8(e),o=e.counts,c=e.status==="approved"&&(o.merged>0||o.building>0||o.needsYou>0||e.building),u=!n||e.owner.trim().toLowerCase()===n.trim().toLowerCase();return t.jsxs("div",{className:`rq-rowcard ${e.status==="questions"||o.needsYou?"you":""}`,children:[t.jsx(gF,{r:e,chip:a,started:c}),u&&t.jsx(_j,{label:`More actions for ${e.id}`,choices:[{key:"delete",danger:!0,title:`squad requirements delete ${e.id}`,label:t.jsxs(t.Fragment,{children:[t.jsx(vn,{size:15})," Delete breakdown…"]}),onPick:()=>r(!0)}]}),s&&t.jsx(Lj,{id:e.id,title:e.title,onClose:()=>r(!1)})]})}function gF({r:e,chip:n,started:s}){const r=e.counts;return t.jsxs(Te,{to:"/requirements/$id",params:{id:e.id},className:"rq-rowlink",children:[t.jsx("span",{className:"rq-rid mono",children:e.id}),t.jsxs("span",{className:"rq-rname",children:[t.jsx("b",{children:e.title}),t.jsxs("span",{children:[t.jsx(mk,{size:12,"aria-hidden":"true"})," ",e.source.name]})]}),t.jsx("span",{className:"rq-rcount",children:r.epics||r.stories?K8(r):"Not broken down yet"}),t.jsxs("span",{className:"rq-rstate",children:[t.jsx(Ub,{...n}),r.needsYou>0&&t.jsxs("span",{className:"rq-rneeds",children:[r.needsYou," ",r.needsYou===1?"needs":"need"," you"]})]}),t.jsx("span",{className:"rq-rprog",children:s&&t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"rq-pb","aria-hidden":"true",children:t.jsx("b",{style:{width:`${r.stories?Math.round(r.merged/r.stories*100):0}%`}})}),t.jsxs("span",{className:"rq-meta",children:[r.merged," of ",r.stories," merged"]})]})})]})}function xF(){const{id:e}=iu({from:"/requirements/$id"}),n=Di({from:"/requirements/$id"}),s=rn({from:"/requirements/$id"}),r=PP(e),a=r.data,o=Vi(Ki),c=p=>void s({search:f=>({...f,...p}),replace:!0}),u=p=>c({item:p,decided:void 0}),d=p=>c({ticket:p});return r.isLoading?t.jsxs("div",{className:"center",children:["Opening ",e,"…"]}):a?t.jsx(yF,{v:a,search:n,select:u,openTicket:d,setSearch:c,phone:o}):t.jsx("div",{className:"center",children:t.jsxs("div",{children:[t.jsx("h2",{children:/404/.test(String(r.error))?`No breakdown ${e}`:`squad-kit could not open ${e}`}),t.jsx("p",{children:/404/.test(String(r.error))?"It may have been deleted.":_i(r.error)}),t.jsx("p",{style:{marginTop:12},children:t.jsx(Te,{to:"/requirements",className:"btn",children:"All breakdowns"})})]})})}function yF({v:e,search:n,select:s,openTicket:r,setSearch:a,phone:o}){const c=wt(),u=rn(),{toast:d}=qe(),[p,f]=$.useState(null),m=qj(e),[y,x]=$.useState(()=>Nx(e,n.item)),k=_=>x(Q=>{const q=new Set(Q);return q.has(_)?q.delete(_):q.add(_),q});$.useEffect(()=>{e.epics.length&&x(_=>_.size?_:Nx(e,n.item))},[e.epics.length]),$.useEffect(()=>{const _=Vn(e,n.item);_&&x(Q=>Q.has(_.epic.key)&&(!_.feature||Q.has(_.feature.key))?Q:new Set([...Q,_.epic.key,..._.feature?[_.feature.key]:[]]))},[n.item,e.epics.length]);const v=e.status==="ready"||e.status==="approved",b=n.view==="map"&&v&&!o,N=e.status==="approved"?"build":"plan",C=Vn(e,n.item)?n.item:void 0,S=!!e.state.build?.on,P=Uk(e),M=No(e)&&!Kr(e.state.job),T=!!(p||n.ticket||m.viewer!==void 0);$.useEffect(()=>{if(!C||T)return;const _=Q=>{if(Q.key!=="Escape"||Q.defaultPrevented||document.querySelector(".modal-veil"))return;const q=Q.target instanceof HTMLElement?Q.target:null;if(q&&/^(INPUT|TEXTAREA|SELECT)$/.test(q.tagName))return q.closest(".rq-panel")?q.blur():void 0;if(document.querySelector('.rq-panel[data-dirty="true"]'))return d("Save or undo your changes first.");s(void 0)};return window.addEventListener("keydown",_),()=>window.removeEventListener("keydown",_)},[C,T]);const F=t.jsx(vF,{v:e,onSend:()=>f({kind:"send"}),onAsk:()=>f({kind:"ask",item:e.id}),phone:o}),R=e.mine?[...e.status==="approved"&&M&&Fo(e).some(({story:_})=>!_.ticket)?[{key:"ask",title:`squad requirements redo ${e.id} ${e.id} "<what to change>"`,label:t.jsxs(t.Fragment,{children:[t.jsx(Pn,{size:15})," Ask the Analyst…"]}),onPick:()=>f({kind:"ask",item:e.id})}]:[],{key:"delete",danger:!0,title:`squad requirements delete ${e.id}`,label:t.jsxs(t.Fragment,{children:[t.jsx(vn,{size:15})," Delete breakdown…"]}),onPick:()=>f({kind:"delete"})}]:[],B=b?`squad requirements show ${e.id} --map`:e.status==="approved"&&e.mine&&e.counts.merged<e.counts.stories?`squad requirements build ${e.id}${S?" --pause":""}`:`squad requirements show ${e.id}`,I=C?t.jsx(lF,{v:e,k:C,onClose:()=>s(void 0),onSelect:s,onAsk:_=>f({kind:"ask",item:_}),onOpenRef:m.open,onOpenTicket:r,onAdd:(_,Q)=>f({kind:"add",level:_,under:Q})}):null,O=_=>t.jsx(hF,{v:e,onSelect:s,onOpenTicket:r,onClose:_});return t.jsxs("div",{className:`rq ${o?"phone":""}`,children:[t.jsxs("header",{className:"rq-head",children:[t.jsxs("div",{className:"rq-h1row",children:[t.jsxs("div",{className:"rq-titlecol",children:[t.jsxs("div",{className:"rq-crumbs",children:[t.jsx(Te,{to:"/requirements",children:"Requirements"})," › ",e.id,e.status==="questions"&&t.jsxs(t.Fragment,{children:[" › ",e.title]})]}),t.jsxs("div",{className:"rq-name",children:[t.jsx(kF,{v:e}),t.jsx(Ub,{...P})]})]}),t.jsx(se,{text:B,keep:B.slice(B.indexOf(e.id))}),v&&!o&&t.jsxs("div",{className:"seg rq-viewseg",role:"group","aria-label":"View",children:[t.jsx("button",{className:b?"":"on","aria-pressed":!b,onClick:()=>a({view:void 0}),children:"Tree"}),t.jsx("button",{className:b?"on":"","aria-pressed":b,onClick:()=>a({view:"map"}),children:"Map"})]}),!o&&F,t.jsx(_j,{choices:R,label:`More actions for ${e.id}`})]}),v&&t.jsx(wF,{v:e,onDecided:()=>a({item:void 0,decided:!0}),onLeftOut:()=>f({kind:"leftout"}),onDoc:()=>m.open()}),e.status==="approved"&&t.jsx(NF,{v:e}),e.status==="ready"&&e.mine&&(e.problems?.length??0)>0&&t.jsxs("div",{className:"rq-probs",id:"rq-probs",role:"note",children:[t.jsx("b",{children:"Before you approve:"}),t.jsxs("ul",{children:[e.problems.slice(0,4).map(_=>t.jsx("li",{children:_},_)),e.problems.length>4&&t.jsxs("li",{children:["and ",e.problems.length-4," more"]})]})]}),!e.mine&&t.jsxs("p",{className:"rq-notmine",children:[e.owner,"'s breakdown: only their squad builds it. You see it read only."]}),t.jsx(SF,{v:e})]}),v?b?t.jsxs("div",{className:"rq-split",children:[t.jsx(pF,{v:e,selected:C,onSelect:_=>s(_),onDecide:r}),I&&t.jsx("div",{className:"rq-aside over",children:I})]}):o?t.jsxs("div",{className:"scroll rq-phonebody",children:[t.jsx(CF,{v:e,onDecide:r}),t.jsx("div",{className:"rq-phonetree",children:t.jsx(hp,{v:e,mode:N,selected:C,open:y,onToggle:k,onSelect:s,onDecide:r,onAdd:(_,Q)=>f({kind:"add",level:_,under:Q})})}),t.jsxs("p",{className:"rq-phonenote",children:["The map view is on bigger screens."," ",e.decided.length>0&&t.jsxs("button",{className:"rq-link",onClick:()=>a({item:void 0,decided:!0}),children:[e.decided.length," decided for you"]})]})]}):t.jsxs("div",{className:"rq-split",children:[t.jsx("div",{className:"scroll rq-treecol",children:t.jsx(hp,{v:e,mode:N,selected:C,open:y,onToggle:k,onSelect:s,onDecide:r,onAdd:(_,Q)=>f({kind:"add",level:_,under:Q})})}),t.jsx("div",{className:`rq-aside ${I?"":`idle ${n.decided?"wanted":""}`}`,children:I??O(n.decided?()=>a({decided:void 0}):void 0)})]}):t.jsx("div",{className:"scroll",children:t.jsxs("div",{className:"rq-pad",children:[e.status==="failed"?t.jsx(nF,{v:e}):e.status==="questions"?t.jsx(sF,{v:e,onOpenRef:m.open}):t.jsx(tF,{v:e}),(e.status==="drafting"||e.status==="failed")&&e.epics.length>0&&t.jsxs("div",{className:"rq-sofar",children:[t.jsx("div",{className:"rq-lab",children:"What it wrote so far"}),t.jsx(hp,{v:e,mode:"plan",open:y,onToggle:k,onDecide:r})]})]})}),o&&v&&!b&&(I||n.decided)&&t.jsx("div",{className:"rq-sheet",children:I??O(()=>a({decided:void 0}))}),o&&v&&e.mine&&t.jsx("div",{className:"rq-bottom",children:F}),n.ticket&&t.jsx(Ab,{id:n.ticket,onClose:()=>a({ticket:void 0})}),p?.kind==="send"&&t.jsx(_P,{v:e,onClose:()=>f(null)}),p?.kind==="ask"&&t.jsx(OP,{v:e,item:p.item,text:p.text,onClose:()=>f(null)}),p?.kind==="add"&&t.jsx(qP,{v:e,level:p.level,under:p.under,onClose:()=>f(null),onAdded:_=>s(_)}),p?.kind==="leftout"&&t.jsx(DP,{v:e,onClose:()=>f(null),onOpenRef:m.open,onAsk:M?_=>f({kind:"ask",item:e.id,text:_}):void 0}),p?.kind==="delete"&&t.jsx(Lj,{id:e.id,title:e.title,sentTo:e.sent?e.tracker?.label:void 0,onClose:()=>f(null),onDeleted:()=>void u({to:"/requirements"})}),m.viewer!==void 0&&t.jsx(Oj,{v:e,at:m.viewer??void 0,onClose:m.close}),c.isPending&&t.jsx("span",{className:"sr-only",role:"status",children:"Working…"})]})}function kF({v:e}){const n=wt(),[s,r]=$.useState(!1),[a,o]=$.useState(e.title);if(!s)return t.jsxs(t.Fragment,{children:[t.jsx("h1",{children:e.title}),e.mine&&t.jsx("button",{className:"iconbtn rq-rename","aria-label":"Rename the breakdown",title:`squad requirements rename ${e.id} "<name>"`,onClick:()=>{o(e.title),r(!0)},children:t.jsx(Lc,{size:13})})]});const c=()=>n.mutate({path:_r(e.id),method:"PATCH",body:{title:a.trim()},done:"Renamed."},{onSuccess:()=>r(!1)});return t.jsxs("form",{className:"rq-renameform",onSubmit:u=>{u.preventDefault(),a.trim()&&c()},children:[t.jsx("input",{className:"input",autoFocus:!0,"aria-label":"Name of the breakdown",value:a,onChange:u=>o(u.target.value),onKeyDown:u=>u.key==="Escape"&&r(!1)}),t.jsx("button",{className:"btn sm pri",type:"submit",disabled:!a.trim()||n.isPending,title:`squad requirements rename ${e.id} ${Le(a.trim()||e.title)}`,children:"Save"}),t.jsx("button",{className:"btn sm",type:"button",onClick:()=>r(!1),children:"Cancel"})]})}function vF({v:e,onSend:n,onAsk:s,phone:r}){const a=wt();if(!e.mine)return null;const o=Kr(e.state.job),c=e.tracker&&t.jsxs("button",{className:"btn",onClick:n,disabled:e.state.sync?.status==="running",title:`squad requirements send ${e.id}`,children:[!r&&t.jsx(hs,{size:14})," ",e.sent?"Send changes":`Send to ${e.tracker.label}`]});if(e.status==="ready"){const f=e.problems??[];return t.jsxs(t.Fragment,{children:[t.jsxs("button",{className:"btn",onClick:s,disabled:o,title:`squad requirements redo ${e.id} ${e.id} "<what to change>"`,children:[!r&&t.jsx(Pn,{size:14})," Ask the Analyst"]}),t.jsxs("button",{className:"btn pri rq-approve",disabled:f.length>0||o||a.isPending,"aria-describedby":f.length?"rq-probs":void 0,title:f.length?f[0]:`squad requirements approve ${e.id}`,onClick:()=>a.mutate({path:`${_r(e.id)}/approve`,done:e.tracker?"Approved. Build continuously, start a story, or send it.":"Approved. Build continuously, or start one story."}),children:[t.jsx(xe,{size:15})," Approve breakdown"]})]})}if(e.status!=="approved")return null;const u=e.counts.stories>0&&e.counts.merged===e.counts.stories,d=!!e.state.build?.on,p=e.state.build?.heldFor==="budget";return t.jsxs(t.Fragment,{children:[c,!u&&d&&t.jsxs("button",{className:"btn",disabled:a.isPending,title:`squad requirements build ${e.id} --pause`,onClick:()=>a.mutate({path:`${_r(e.id)}/build`,body:{on:!1},done:"Paused. Running stories finish their step; no new ones start."}),children:[t.jsx(uu,{size:14})," Pause"]}),!u&&(!d||p)&&t.jsxs("button",{className:"btn pri",disabled:a.isPending,title:p?`Go on past this month's budget: squad requirements build ${e.id}`:`squad requirements build ${e.id}`,onClick:()=>a.mutate({path:`${_r(e.id)}/build`,body:{on:!0},done:p?"It goes on past this month's budget, for the rest of the month.":"Building continuously. Stories start in order of what they need."}),children:[t.jsx(Wi,{size:14})," Build continuously"]})]})}function pp(e,n,s=`${n}s`){return`${e} ${e===1?n:s}`}function jF(e,n){return n&&e.trim().toLowerCase()===n.trim().toLowerCase()?"you":e}function bF(e){const n=new Date(e);return n.toDateString()===new Date().toDateString()?"today":`on ${n.toLocaleDateString([],{day:"numeric",month:"short"})}`}function wF({v:e,onDecided:n,onLeftOut:s,onDoc:r}){const a=Qe(),o=a.data?.ready?a.data.meta.user?.name:void 0,c=e.source,u=e.estimate,d=Rf(u),p=e.counts,f=e.status==="ready";return t.jsxs("div",{className:"rq-info",children:[t.jsxs("span",{children:["From"," ",t.jsx("button",{className:"rq-link",onClick:r,title:"Open the document",children:c.name}),c.kind==="pdf"&&c.pages?`, ${pp(c.pages,"page")}`:"",c.pictures?`, ${pp(c.pictures,"picture")}`:"",", added by ",jF(c.addedBy,o)," ",bF(c.addedAt)]}),t.jsxs("span",{children:[t.jsx("b",{children:p.epics})," ",p.epics===1?"epic":"epics",", ",t.jsx("b",{children:p.features})," ",p.features===1?"feature":"features",", ",t.jsx("b",{children:p.stories})," ",p.stories===1?"story":"stories"]}),f&&u.stories>0&&t.jsxs("span",{children:["About ",d.cost&&t.jsxs(t.Fragment,{children:[t.jsx("b",{children:d.cost})," and "]}),t.jsx("b",{children:d.time})," to build, ",u.parallel," at a time ",t.jsxs("span",{className:"rq-dim",children:["(",Hk(u),")"]})]}),e.decided.length>0&&t.jsxs("button",{className:"rq-link",onClick:n,children:[e.decided.length," decided for you"]}),e.leftOut.length>0&&t.jsxs("button",{className:"rq-link",onClick:s,children:[pp(e.leftOut.length,"part")," left out"]}),e.sent&&e.tracker&&t.jsxs("span",{children:["Sent to ",e.tracker.label]})]})}function NF({v:e}){const n=wt(),s=e.counts,r=l7(s),a=!!e.state.build?.on,o=e.state.build?.held,c=e.state.sync,u=s.merged+s.building+s.needsYou>0||e.progress.some(x=>x.ticket),d=Math.max(0,s.stories-s.merged-s.building-s.needsYou),p=h7(e),f=Fp(c,Fj(e.id)),m=Gk(f),y="It stops only for a missing part, a clash or a failed check, and merges each story when its checks and review pass. You send releases out from Releases.";return t.jsxs("div",{className:"rq-build",children:[u||a?t.jsxs("div",{className:"rq-progress",children:[t.jsxs("span",{className:"rq-segbar",role:"img","aria-label":`${s.merged} of ${s.stories} stories merged, ${s.building} building, ${s.needsYou} need you`,children:[r.merged>0&&t.jsx("i",{className:"m",style:{flexGrow:r.merged}}),r.building>0&&t.jsx("i",{className:"b",style:{flexGrow:r.building}}),r.needsYou>0&&t.jsx("i",{className:"y",style:{flexGrow:r.needsYou}}),r.rest>0&&t.jsx("i",{className:"w",style:{flexGrow:r.rest}})]}),t.jsxs("span",{className:"rq-pnum",children:[t.jsxs("b",{children:[s.merged," of ",s.stories]})," ","merged"]}),t.jsx("span",{className:"rq-meta",children:[s.building?`${s.building} building`:"",s.needsYou?`${s.needsYou} ${s.needsYou===1?"needs":"need"} you`:"",d?`${d} to go`:""].filter(Boolean).join(", ")}),s.merged<s.stories&&t.jsx("span",{className:"rq-meta",children:Z8(e.estimate)})]}):e.mine&&t.jsxs("div",{className:"rq-rule",children:["Build continuously: ",G8(e.estimate),". ",y]}),(u||a)&&a&&s.merged<s.stories&&t.jsxs("div",{className:"rq-rule",children:[e.estimate.parallel," at a time. ",y]}),p&&t.jsxs("div",{className:"rq-built",role:"status",children:[t.jsx(xe,{size:14,strokeWidth:2.6,"aria-hidden":"true"}),t.jsxs("span",{children:[p.text,p.release&&t.jsxs(t.Fragment,{children:[" ","Send it out from ",t.jsx(Te,{to:"/releases",children:"Releases"}),"."]})]})]}),o&&(a||e.state.build?.heldFor==="budget")&&t.jsxs("div",{className:"rq-held",role:"status",children:[t.jsx(uu,{size:13,"aria-hidden":"true"})," Waiting: ",o]}),c&&(c.status==="running"||c.status==="pending")&&t.jsxs("div",{className:"rq-syncline",role:"status",children:["Sending to ",e.tracker?.label??"the tracker",m?`: ${m}`:"…",t.jsx("span",{className:"rq-pbar",children:t.jsx("i",{style:{width:`${f.pct||5}%`}})})]}),c?.status==="failed"&&t.jsxs("div",{className:"rq-syncline fail",role:"alert",children:["The send to ",e.tracker?.label??"the tracker"," stopped",c.error?`: ${c.error}`:".",e.mine&&t.jsx("button",{className:"btn sm",disabled:n.isPending,onClick:()=>n.mutate({path:`${_r(e.id)}/send`,done:"Sending again. What was sent stays; nothing is made twice."}),children:"Send again"})]})]})}function SF({v:e}){const n=wt(),s=e.state.job;return!Kr(s)||e.status!=="ready"&&e.status!=="approved"?s?.status==="failed"&&s.step==="redo"&&(e.status==="ready"||e.status==="approved")?t.jsxs("div",{className:"rq-jobline fail",role:"status",children:["The redo of ",s.item===e.id?"the breakdown":s.item," stopped",s.error?`: ${s.error}`:".",e.mine&&t.jsx("button",{className:"btn sm",onClick:()=>n.mutate({path:`${_r(e.id)}/retry`,done:"The Analyst tries the redo again."}),children:"Try again"})]}):null:t.jsxs("div",{className:"rq-jobline",role:"status",children:[t.jsx("span",{className:"live","aria-hidden":"true"}),s.status==="stopping"?"Stopping the Analyst…":`${s.now??"The Analyst is working"}${s.ask?`: "${s.ask}"`:""}`,e.mine&&s.status!=="stopping"&&t.jsx("button",{className:"btn sm",onClick:()=>n.mutate({path:`${_r(e.id)}/stop`,done:"Stopping the Analyst."}),title:`squad requirements stop ${e.id}`,children:"Stop"})]})}function CF({v:e,onDecide:n}){const s=Qe(),r=s.data?.ready?s.data.tickets:[],a=e.progress.filter(c=>c.state==="needs-you"),o=$.useMemo(()=>a.map(c=>{const u=Vn(e,c.key)?.story,d=c.ticket?r.find(f=>f.id===c.ticket):void 0,p=d?.agentQuestion?.text?Qk(d.agentQuestion.text):d?.waiting?.summary;return t.jsxs("div",{className:"rq-youcard",children:[t.jsx("div",{className:"rq-pop-w",children:[c.key,c.ticket,Yk(c.stop)].filter(Boolean).join(" · ")}),t.jsxs("div",{className:"rq-youcard-t",children:[u?.title,p?`: ${p.charAt(0).toLowerCase()}${p.slice(1)}`:""]}),c.ticket&&t.jsx("button",{className:"btn you",onClick:()=>n(c.ticket),children:"Decide"})]},c.key)}),[a.map(c=>c.key+c.ticket).join(),r]);return t.jsx(t.Fragment,{children:o})}const At=n6({component:gt?dI:NM,beforeLoad:({location:e})=>{if(!gt&&e.pathname!=="/")throw nu({to:"/"})}}),$F=Ot({getParentRoute:()=>At,path:"/",beforeLoad:()=>{if(gt)throw nu({to:"/overview"})}}),EF=Ot({getParentRoute:()=>At,path:"/setup",component:ZM}),TF=Ot({getParentRoute:()=>At,path:"/overview",component:BM}),AF=Ot({getParentRoute:()=>At,path:"/requirements",component:fF}),PF=Ot({getParentRoute:()=>At,path:"/requirements/$id",validateSearch:e=>({item:typeof e.item=="string"&&e.item?e.item:void 0,view:e.view==="map"?"map":void 0,ticket:typeof e.ticket=="string"&&e.ticket?e.ticket:void 0,decided:e.decided===!0||e.decided==="true"?!0:void 0}),component:xF}),RF=Ot({getParentRoute:()=>At,path:"/board",validateSearch:e=>({ticket:typeof e.ticket=="string"&&e.ticket?e.ticket:void 0,view:e.view==="mine"||e.view==="bugs"?e.view:void 0}),component:Nz}),IF=Ot({getParentRoute:()=>At,path:"/tickets/$id/proof",component:Ez}),zF=Ot({getParentRoute:()=>At,path:"/backlog",component:Iz}),MF=Ot({getParentRoute:()=>At,path:"/inbox",component:nM}),FF=Ot({getParentRoute:()=>At,path:"/releases",component:Tz}),LF=Ot({getParentRoute:()=>At,path:"/decisions",beforeLoad:()=>{throw nu({to:"/architecture",search:{view:"list"}})}}),_F=Ot({getParentRoute:()=>At,path:"/architecture",validateSearch:e=>({adr:typeof e.adr=="string"&&e.adr?e.adr:void 0,view:["timeline","stack","list","project","lessons"].includes(e.view)?e.view:void 0}),component:Fz}),OF=Ot({getParentRoute:()=>At,path:"/conversations",validateSearch:e=>({ticket:typeof e.ticket=="string"&&e.ticket?e.ticket:void 0}),component:RM}),qF=Ot({getParentRoute:()=>At,path:"/bugs",component:sM}),DF=Ot({getParentRoute:()=>At,path:"/squad",component:iM}),BF=Ot({getParentRoute:()=>At,path:"/settings",component:jM}),WF=At.addChildren([$F,EF,TF,AF,PF,RF,zF,IF,MF,OF,FF,LF,_F,qF,DF,BF]),UF=p6({routeTree:WF,defaultPreload:!1,basepath:zi||"/",defaultErrorComponent:db}),HF=2e3;function VF(){const e=Tb(),n=zn();$.useEffect(()=>{const r=()=>{fetch("/healthz",{cache:"no-store"}).then(()=>y6(),()=>ek())},a=window.setInterval(r,HF);return()=>window.clearInterval(a)},[]);const s=$.useRef(e);return $.useEffect(()=>{e==="down"?document.documentElement.dataset.appDown="1":delete document.documentElement.dataset.appDown,e==="up"&&s.current!=="up"&&n.invalidateQueries(),s.current=e},[e,n]),e==="up"?null:t.jsxs("div",{className:"appdown",role:"alert",children:[t.jsx("span",{className:"upd-ic",children:t.jsx(dr,{size:16})}),t.jsx("div",{className:"upd-main",children:e==="down"?t.jsxs(t.Fragment,{children:[t.jsx("b",{className:"upd-title",children:"squad-kit has stopped, so this page is not up to date"}),t.jsx("span",{className:"upd-sub",children:"Your work and what you typed are safe. Start it again in a terminal. This page comes back by itself."})]}):t.jsxs(t.Fragment,{children:[t.jsx("b",{className:"upd-title",children:"This page's link is out of date"}),t.jsx("span",{className:"upd-sub",children:"Run this in a terminal: it opens the board with a fresh link. What you typed is kept."})]})}),t.jsx("div",{className:"upd-acts",children:t.jsx(se,{text:"squad"})})]})}document.documentElement.dataset.theme=Ek();const KF=new j4({defaultOptions:{queries:{staleTime:500,retry:1,refetchOnWindowFocus:!0}}}),Hb=document.getElementById("root");if(!Hb)throw new Error("missing #root");const YF=b6();LA();K3.createRoot(Hb).render(t.jsx($.StrictMode,{children:YF?t.jsx(b4,{client:KF,children:t.jsxs(yx,{children:[t.jsx(VF,{}),t.jsx(Qy,{children:t.jsx(g6,{router:UF})}),t.jsx(Qy,{fallback:null,children:t.jsx(PA,{})})]})}):t.jsx(yx,{children:t.jsx("div",{className:"center",style:{height:"100%"},children:t.jsxs("div",{style:{maxWidth:460},children:[t.jsx("h2",{children:"Open squad-kit once from a terminal"}),t.jsx("p",{children:"This browser has not opened squad-kit yet, so it does not have its private link. Run this in a terminal: it opens the board here, and after that new tabs and bookmarks work too."}),t.jsx(se,{text:"squad"})]})})})}));